제출 #518364

#제출 시각아이디문제언어결과실행 시간메모리
518364drkarlicio2107Cards (LMIO19_korteles)C++14
0 / 100
138 ms5628 KiB
#include <bits/stdc++.h> using namespace std; int x [30][30]; int y [30][30]; int z [30][30]; int q [30][30]; int xy [30][30][30]; int yz [30][30][30]; int zq [30][30][30]; int qx [30][30][30]; int xz [30][30][30][30]; int yq [30][30][30][30]; int xyzq [30][30][30][30]; int main(){ int n; cin >> n; long long int ans=0; for (int i=0; i<n; i++){ char a1,b1,c1,d1; cin >> a1 >> b1 >> c1 >> d1; int a=a1-'A', b=b1-'A', c=d1-'A', d=c1-'A'; ans+=x[a][b]+y[b][c]+z[c][d]+q[d][a]; ans-=(xz [a][b][c][d]+yq[a][b][c][d]); //cout << ans << " " << zq[a][c][d] << endl; if (a==c){ ans-=(xy[a][b][c]+zq[a][d][c]); } //cout << ans << endl; if (b==d){ ans-=(yz[b][c][d]+qx[d][a][b]); } //cout << ans << endl; if (a==c && b==d){ ans+=xyzq [a][b][c][d]; } x[d][c]++; y [a][d]++; z [b][a]++; q [c][b]++; xy[d][a][d]++; zq[b][a][b]++; yz[a][b][a]++; qx[c][b][c]++; xz [d][c][b][a]++; yq [b][a][c][d]; xyzq [c][b][d][a]++; //cout << ans << endl; } cout << ans; }

컴파일 시 표준 에러 (stderr) 메시지

korteles.cpp: In function 'int main()':
korteles.cpp:28:36: warning: statement has no effect [-Wunused-value]
   28 |   xz [d][c][b][a]++; yq [b][a][c][d];
      |                      ~~~~~~~~~~~~~~^
#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...