제출 #598861

#제출 시각아이디문제언어결과실행 시간메모리
598861MrDebooCards (LMIO19_korteles)C++17
36 / 100
1099 ms66380 KiB
#include <bits/stdc++.h> #define int long long #define endl '\n' using namespace std; signed main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); int n; cin>>n; map<string,int>mp; int ans=0; for(int i=0;i<n;i++){ string chr[2][2]; for(int w=0;w<2;w++){ for(int j=0;j<2;j++){ char c; string f; cin>>c; f+=c; chr[w][j]=f; } } for(int w=1;w<(1<<4);w++){ string g,G; for(int j=0;j<4;j++){ if((1<<j)&w){ if(j==2)G+=chr[0][0]+chr[0][1]; if(j==3)G+=chr[0][1]+chr[1][1]; if(j==0)G+=chr[1][0]+chr[1][1]; if(j==1)G+=chr[0][0]+chr[1][0]; }else G+=".."; } ans+=mp[G]*(__builtin_popcount(w)%2?1:-1); } for(int w=1;w<(1<<4);w++){ string g,G; for(int j=0;j<4;j++){ if((1<<j)&w){ if(j==0)g+=chr[0][0]+chr[0][1]; if(j==1)g+=chr[0][1]+chr[1][1]; if(j==2)g+=chr[1][0]+chr[1][1]; if(j==3)g+=chr[0][0]+chr[1][0]; }else g+=".."; } mp[g]++; } } cout<<ans; }
#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...