Submission #598864

# Submission time Handle Problem Language Result Execution time Memory
598864 2022-07-19T06:36:39 Z almothana05 Cards (LMIO19_korteles) C++14
36 / 100
1000 ms 42624 KB
#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

korteles.cpp: In function 'int main()':
korteles.cpp:15:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |       for(int j = 0 ; j < t.size() ; j++){
      |                       ~~^~~~~~~~~~
korteles.cpp:9:22: warning: unused variable 'numm' [-Wunused-variable]
    9 |    long long menge , numm , nummer , len, erg = 0;
      |                      ^~~~
korteles.cpp:9:29: warning: unused variable 'nummer' [-Wunused-variable]
    9 |    long long menge , numm , nummer , len, erg = 0;
      |                             ^~~~~~
korteles.cpp:9:38: warning: unused variable 'len' [-Wunused-variable]
    9 |    long long menge , numm , nummer , len, erg = 0;
      |                                      ^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 3 ms 980 KB Output is correct
7 Correct 5 ms 660 KB Output is correct
8 Correct 10 ms 2388 KB Output is correct
9 Correct 7 ms 1620 KB Output is correct
10 Correct 7 ms 1620 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1089 ms 42624 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 240 ms 18828 KB Output is correct
3 Execution timed out 1091 ms 40836 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 3 ms 980 KB Output is correct
3 Correct 5 ms 660 KB Output is correct
4 Correct 10 ms 2388 KB Output is correct
5 Correct 7 ms 1620 KB Output is correct
6 Correct 7 ms 1620 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Execution timed out 1089 ms 42624 KB Time limit exceeded
13 Halted 0 ms 0 KB -