Submission #598855

#TimeUsernameProblemLanguageResultExecution timeMemory
598855almothana05Cards (LMIO19_korteles)C++14
36 / 100
1075 ms29656 KiB
#include<bits/stdc++.h> #define mod 1000000007 using namespace std; map<string , int>links , rechts , ob , un ; map<string , int>karte, linkob , obrech , rechun , untlink ; int main(){ 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)

korteles.cpp: In function 'int main()':
korteles.cpp:13:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |       for(int j = 0 ; j < t.size() ; j++){
      |                       ~~^~~~~~~~~~
korteles.cpp:7:22: warning: unused variable 'numm' [-Wunused-variable]
    7 |    long long menge , numm , nummer , len, erg = 0;
      |                      ^~~~
korteles.cpp:7:29: warning: unused variable 'nummer' [-Wunused-variable]
    7 |    long long menge , numm , nummer , len, erg = 0;
      |                             ^~~~~~
korteles.cpp:7:38: warning: unused variable 'len' [-Wunused-variable]
    7 |    long long menge , numm , nummer , len, erg = 0;
      |                                      ^~~
#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...