CodeChef submission 136788 (C++ 4.3.2) plaintext list. Status: WA, problem SNCK01, contest SNACKDWN. By cspirits2 (cspirits2), 2009-11-21 23:57:18.
#include<iostream> #include<algorithm> #include<vector> using namespace std; bool func(vector<int> xx) { int c=0; while(xx[c]==1) { c++; if(c==xx.size()) break; } if(c%2==0 && xx.size()==c) return 0; if(c%2==1 && xx.size()==c) return 1; if(c%2==0)return 1; return 0; } int main() { int t; cin >>t; while(t--) { int n,m; cin >>n; cin >> m; int win=0,lose=0; for(int i=0;i<n;i++) { vector<int> xx; for(int i=0;i<m;i++) { int temp; cin >> temp; xx.push_back(temp); } bool f=func(xx); if(f) win++; else lose++; } if(win %2==0)cout<<"SECOND\n"; else cout<<"FIRST\n"; } return 0; }
Comments

