# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
598864 | almothana05 | Cards (LMIO19_korteles) | C++14 | 1091 ms | 42624 KiB |
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>
#define mod 1000000007
using namespace std;
unordered_map<string , int>links , rechts , ob , un ;
unordered_map<string , int>karte, linkob , obrech , rechun , untlink ;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long menge , numm , nummer , len, erg = 0;
string s, t;
cin >> menge;
for(int i = 0 ; i < menge ; i++){
cin >> s;
cin >> t;
for(int j = 0 ; j < t.size() ; j++){
s += t[j];
}
t.clear();
t += s[0];
t += s[2];
erg += rechts[t];
t.clear();
t += s[1];
t += s[3];
erg += links[t];
t.clear();
t += s[0];
t += s[1];
erg += un[t];
t.clear();
t += s[2];
t += s[3];
erg += ob[t];
if(s[0] == s[3] && s[1] == s[2]){
t.clear();
t += s[1];
t += s[0];
t += s[3];
t += s[2];
if(karte[t] > 0){
erg += 3;
}
}
/////////////////////////////////////////////////////
t.clear();
t += s[1];
t += s[0];
t += s[3];
t += s[2];
erg -= karte[t];
t.clear();
t += s[2];
t += s[3];
t += s[0];
t += s[1];
erg -= karte[t];
//////////////////////////////////////////////////////
t.clear();
t += s[3];
t += s[1];
t += s[2];
t += s[3];
erg -= linkob[t];
// cout << erg << "\n";
t.clear();
t += s[2];
t += s[3];
t += s[0];
t += s[2];
erg -= obrech[t];
t.clear();
t += s[0];
t += s[2];
t += s[1];
t += s[0];
erg -= rechun[t];
t.clear();
t += s[1];
t += s[0];
t += s[3];
t += s[1];
erg -= untlink[t];
////////////////////////////////////////////////////// upd
karte[s]++;
t.clear();
t += s[0];
t += s[2];
links[t]++;
t.clear();
t += s[1];
t += s[3];
rechts[t]++;
t.clear();
t += s[0];
t += s[1];
ob[t]++;
t.clear();
t += s[2];
t += s[3];
un[t]++;
//////////////////////////////////////////////////////up3
t.clear();
t += s[2];
t += s[0];
t += s[0];
t += s[1];
// cout << "suii " << t << "\n";
linkob[t]++;
t.clear();
t += s[0];
t += s[1];
t += s[1];
t += s[3];
obrech[t]++;
t.clear();
t += s[1];
t += s[3];
t += s[3];
t += s[2];
rechun[t]++;
t.clear();
t += s[3];
t += s[2];
t += s[2];
t += s[0];
untlink[t]++;
// cout << erg << "\n";
}
cout << erg<< "\n";
}
Compilation message (stderr)
# | 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... |