This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
da=da+s[0]+s[2];
db=db+s[1]+s[3];
dc=dc+t[0]+t[2];
dd=dd+t[1]+t[3];
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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |