Codeforces Round #382 (Div. 1), problem: (E) Chess Championship Solution in C/C++
#include<iostream> #include<cstdio> #include<algorithm> #define N 3010 using namespace std; int n,m,f; struct ma{int x,y;}a; bool operator<(ma p,ma q){return p.x>q.x;} void get(int k) { sort(a+k,a+n+1); int w=a.x; for(int i=n;i>k;i--) { if(w>1) w-=2,f.y].y]=1; else if(!w) a.x-=2,f.y].y]=1; else …