제출 #588206

#제출 시각아이디문제언어결과실행 시간메모리
588206koloCards (LMIO19_korteles)C++14
19 / 100
1087 ms31880 KiB
#include <bits/stdc++.h> using namespace std; map<string,int> mg,md,ml,mp; set<string> se; long long w,n; string s; char pg,pd,lg,ld; bool czy_pozioma_os_symetrii(string karta){ // string karta = ""s + pg+lg+pd+ld; return (karta[0] == karta[2] && karta[1]==karta[3]); } bool czy_pionowa_os_symetrii(string karta){ // string karta = ""s + pg+lg+pd+ld; return (karta[0] == karta[1] && karta[2]==karta[3]); } bool symetria_osiowa(string karta){ // string karta = ""s + pg+lg+pd+ld; return karta[0] == karta[3] && karta[1]==karta[2]; } string lusterko_pionowo(string karta){ return ""s + karta[1]+karta[0]+karta[3]+karta[2]; } 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; mg[""s + lg + pg]++; md[""s + ld + pd]++; ml[""s + lg + ld]++; mp[""s + pg + pd]++; if(czy_pozioma_os_symetrii(karta)) w--; if(czy_pionowa_os_symetrii(karta)) w--; if(symetria_osiowa(karta)){ if(se.count(lusterko_pionowo(karta))) w-=3; } else { if(se.count(lusterko_pionowo(karta))) w--; if(se.count(lusterko_poziomo(karta))) w--; } se.insert(karta); //cout << "wczesniej : " << w << "\n"; } //cout << "g\n"; for(auto e : md){ s=e.first; w+=e.second*mg[s]; //cout << w << " : " << e.first << " : " << e.second << " : " << odwroc(s) << " : " << mg[odwroc(s)] << "\n"; } //cout << "p\n"; for(auto e : mp){ s=e.first; w+=e.second*ml[s]; //cout << w << " : " << e.first << " : " << e.second << " : " << odwroc(s) << " : " << ml[odwroc(s)] << "\n"; } //cout << "odp: "; 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...