Submission #502612

#TimeUsernameProblemLanguageResultExecution timeMemory
502612lukxAedCards (LMIO19_korteles)C++14
36 / 100
1056 ms17248 KiB
#include <bits/stdc++.h> using namespace std; int N,rj; string a,b; string karte[456976]; int main() { cin>>N; for(int i=0;i<N;i++) { cin>>a>>b; karte[i]=a+b; } for(int i=0;i<N;i++) { for(int j=i+1;j<N;j++) { string s=karte[i]; string t=karte[j]; string da="", db="", dc="", dd=""; for(int i=0;i<4;i++) { if(i%2==0) { da+=s[i]; dc+=t[i]; } else { db+=s[i]; dd+=t[i]; } } if(s.substr(2,3)==t.substr(0,2)) { rj++; } else if(s.substr(0,2)==t.substr(2,3)) { rj++; } else if(da==dd) { rj++; } else if(db==dc) { rj++; } } } cout<<rj; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...