Codeforces Round #390 (Div. 2), problem: (B) Ilya and tic-tac-toe game Solution in C/C++

By |2017-04-07T22:11:45+00:00January 6th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

Codeforces Round #390 (Div. 2), problem: (B) Ilya and tic-tac-toe game Solution in C/C++   #include<stdio.h> #include<stdlib.h> typedef unsigned u; char S[4][4];u x,o; void chk(u r,u c,u dr,u dc,u s,u l) { if(!(dr|dc))dr=-(dc=1); if(r>3||c>3){x=o=0;return;} if(l)x=o=0; if(S[r][c]=='x')++x; if(S[r][c]=='o')++o; if(s)chk(r+dr,c+dc,dr,dc,s-1,0); return; } int main() { u [...]