Submission #598855

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

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 time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 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 4 ms 980 KB Output is correct
7 Correct 6 ms 596 KB Output is correct
8 Correct 17 ms 2604 KB Output is correct
9 Correct 13 ms 1548 KB Output is correct
10 Correct 18 ms 1520 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1075 ms 29656 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 540 ms 20116 KB Output is correct
3 Execution timed out 1068 ms 28072 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 4 ms 980 KB Output is correct
3 Correct 6 ms 596 KB Output is correct
4 Correct 17 ms 2604 KB Output is correct
5 Correct 13 ms 1548 KB Output is correct
6 Correct 18 ms 1520 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Execution timed out 1075 ms 29656 KB Time limit exceeded
13 Halted 0 ms 0 KB -