Submission #588375

#TimeUsernameProblemLanguageResultExecution timeMemory
588375koloCards (LMIO19_korteles)C++14
36 / 100
1092 ms12652 KiB
#include <bits/stdc++.h> using namespace std; map<string,set<string>> mg,md,ml,mp; set<string> se; long long w,n; string s; char pg,pd,lg,ld; inline bool czy_pozioma_os_symetrii(string karta){ // string karta = ""s + pg+lg+pd+ld; return (karta[0] == karta[2] && karta[1]==karta[3]); } inline bool czy_pionowa_os_symetrii(string karta){ // string karta = ""s + pg+lg+pd+ld; return (karta[0] == karta[1] && karta[2]==karta[3]); } inline bool symetria_osiowa(string karta){ // string karta = ""s + pg+lg+pd+ld; return karta[0] == karta[3] && karta[1]==karta[2]; } inline string lusterko_pionowo(string karta){ return ""s + karta[1]+karta[0]+karta[3]+karta[2]; } inline string lusterko_poziomo(string karta){ // string karta = ""s + pg+lg+pd+ld; return ""s + karta[2]+karta[3]+karta[0]+karta[1]; } int main(){ iostream::sync_with_stdio(0); cin.tie(0); cin >> n; for(int t = 0;t < n;t++){ cin >> lg >> pg >> ld >> pd; string karta = ""s + pg+lg+pd+ld; //sprawdzamy pary set<string> pary; pary.clear(); for(auto e : md[""s + lg + pg] ) pary.insert(e); for(auto e : md[""s + lg + pg] ) pary.insert(e); for(auto e : mg[""s + ld + pd] ) pary.insert(e); for(auto e : mp[""s + lg + ld] ) pary.insert(e); for(auto e : ml[""s + pg + pd] ) pary.insert(e); w+=pary.size(); //dodajemy karte mg[""s + lg + pg].insert(karta); ml[""s + lg + ld].insert(karta); md[""s + ld + pd].insert(karta); mp[""s + pg + pd].insert(karta); } cout << w; return 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...