CodeChef submission 136796 (C++ 4.3.2) plaintext list. Status: WA, problem SNCK01, contest SNACKDWN. By neoalgorist (neoalgorist), 2009-11-21 23:58:14.
#include<iostream> #include<algorithm> #include<iterator> #include<map> #include<vector> #include<list> #include<set> #include<queue> #include<deque> #include<stack> #include<bitset> #include<functional> #include<utility> #include<fstream> #include<iosfwd> #include<sstream> #include<iomanip> #include<string> #include<cmath> #include<cstring> #include<ctime> #include<cstdio> #include<cstring> #include<cstdlib> #include<cctype> #include<cassert> #include<complex> #include<numeric> using namespace std; #define DEBUG 0 #define BUG(x) cout<<"Debugging Variable "<< #x <<endl #define SYS system("pause") #define VAR(x,a) __typeof(a) x(a) #define FORD(i,a,b) for(int i = (int)a,_b = (int)b;i>=(_b);--i) #define FOREACH(it,v) for(VAR(it,(v).begin());it!=(v).end();++it) #define FOR(i,a,b) for(int i=(int)(a),_b = (int)b;i<(int)(_b);++i) #define REP(i,n) FOR(i,0,n) #define REPD(i,n) FORD(i,n,0) #define Size() size() #define PB push_back #define PF push_front #define MP make_pair #define SZ size() #define ALL(X) X.begin(),X.end() #define RALL(X) X.rbegin(),X.rend() #define Clear(X) memset(X,0,sizeof(X)) #define PushBack push_back #define PushFront push_front #define MakePair make_pair #define PopBack pop_back #define PopFront pop_front #define BitCount __builtin_popcount #define INF 100000000 #define INFLL 10000000000000000LL typedef vector< int > VI; typedef vector< double > VD; typedef vector< string > VS; typedef vector< char > VC; typedef vector< long double > VLD; typedef vector< long long > VLL; typedef vector< vector< int > > VVI; typedef vector< pair< int,int > > VPII; typedef vector< vector< double > > VVD; typedef vector< vector< char > > VVC; typedef vector< vector< string > > VVS; typedef vector< vector< long long > > VVLL; typedef string SS; typedef unsigned long long ULL; typedef long long LL; typedef long double LD; typedef pair< int,int > PII; typedef unsigned long UL; int RInt(){int N;scanf("%d",&N);return N;} SS RSS(){SS S;cin>>S;return S;} LL RLL(){LL N;cin>>N;return N;} void DInt(int X){cout<<"Value Of Variable = "<<X<<endl;} void DSS(SS S){cout<<"String is "<<S<<endl;} void DVInt(VI V){cout<<"Vector Size = "<<V.SZ<<endl;cout<<"Elements "<<endl;REP(i,V.SZ)cout<<V[i]<<" ";cout<<endl;} void DLL(LL X){cout<<"Value Of Variable = "<<X<<endl;} char *RESULT(int a[50][50],int n,int m); int row,col; int check(int a[50][50],int n,int m); int VAL(int a[50][50],int n,int m); int main() { int T=RInt(); int S[50][50]; while(T--) { int N=RInt(),M=RInt(); int rest=0; int no1=0; int c[50][2]={0}; REP(i,N) REP(j,M) { S[i][j]=RInt(); if(S[i][j]%2==0) c[j][1]++; else c[j][0]++; } REP(i,M) if(c[i][0]%2==0||c[i][1]%2==1) no1++; else rest++; if(no1<rest) else } return 0; } /* int check(int a[50][50],int n,int m) { int found=0; REP(i,n) REP(j,m) if(a[i][j]!=0) { found=1; break; } if(found) return 1; else return 0; } int VAL(int a[50][50],int n,int m) { int max=0; REP(i,n) REP(j,m) { int lm=0; if(a[i][j]!=0) lm=1; if(max<a[i][j]) { max=a[i][j]; row=i; col=j; } if(lm!=0) break; } return max; } char *RESULT(int a[50][50],int n,int m) { int chance=0; while(chance<(n*m)) { chance++; int pick=VAL(a,n,m); // chance+=pick; a[row][col]=0; for(int k=1;k<pick;k++) { chance++; int var=0,x,l; for(l=col+1;l<m;l++) { if(var<a[row][l]) { var=a[row][l]; x=l; } } a[row][l]=0; } } chance=chance%2; if(chance) return "FIRST"; else return "SECOND"; } */
Comments

