# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
588375 |
2022-07-03T08:39:39 Z |
kolo |
Cards (LMIO19_korteles) |
C++14 |
|
1000 ms |
12652 KB |
#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 time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
324 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
2 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 |
324 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
2 ms |
728 KB |
Output is correct |
7 |
Correct |
18 ms |
812 KB |
Output is correct |
8 |
Correct |
8 ms |
1360 KB |
Output is correct |
9 |
Correct |
44 ms |
1308 KB |
Output is correct |
10 |
Correct |
24 ms |
1364 KB |
Output is correct |
11 |
Correct |
1 ms |
316 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1092 ms |
12652 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
316 KB |
Output is correct |
2 |
Execution timed out |
1084 ms |
11308 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
728 KB |
Output is correct |
3 |
Correct |
18 ms |
812 KB |
Output is correct |
4 |
Correct |
8 ms |
1360 KB |
Output is correct |
5 |
Correct |
44 ms |
1308 KB |
Output is correct |
6 |
Correct |
24 ms |
1364 KB |
Output is correct |
7 |
Correct |
1 ms |
316 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
324 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
2 ms |
340 KB |
Output is correct |
12 |
Execution timed out |
1092 ms |
12652 KB |
Time limit exceeded |
13 |
Halted |
0 ms |
0 KB |
- |