Submission #10330400
Source Code Expand
#include <bits/stdc++.h> typedef long long ll; typedef long double ld; using namespace std; int main(){ int N; cin >> N; vector<int> R(N), H(N); for(int i=0; i<N; i++){ cin >> R[i] >> H[i]; H[i]--; } int maxR = 100000; vector<vector<int>> G(maxR + 1, vector<int>(3)); for(int i=0; i<N; i++){ G[R[i]][H[i]]++; } for(int i=1; i<=maxR; i++) for(int j=0; j<3; j++){ G[i][j] += G[i-1][j]; } for(int i=0; i<N; i++){ int even = G[R[i]][H[i]] - G[R[i] - 1][H[i]] - 1; int vic = G[R[i]][(H[i]+1)%3] - G[R[i]-1][(H[i]+1)%3]; for(int j=0; j<3; j++){ vic += G[R[i]-1][j]; } int lose = N - 1 - even - vic; cout << vic << " " << lose << " " << even << endl; } }
Submission Info
Submission Time | |
---|---|
Task | B - AtCoderでじゃんけんを |
User | yapoo |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 824 Byte |
Status | AC |
Exec Time | 241 ms |
Memory | 8320 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 233 ms | 7808 KB |
02.txt | AC | 241 ms | 7808 KB |
03.txt | AC | 214 ms | 7936 KB |
04.txt | AC | 215 ms | 7936 KB |
05.txt | AC | 209 ms | 8192 KB |
06.txt | AC | 207 ms | 8192 KB |
07.txt | AC | 208 ms | 8320 KB |
08.txt | AC | 208 ms | 8192 KB |
09.txt | AC | 209 ms | 8320 KB |
10.txt | AC | 209 ms | 8192 KB |
11.txt | AC | 227 ms | 7808 KB |
12.txt | AC | 224 ms | 7808 KB |
13.txt | AC | 222 ms | 7808 KB |
14.txt | AC | 224 ms | 7424 KB |
15.txt | AC | 224 ms | 7424 KB |
16.txt | AC | 226 ms | 7424 KB |
17.txt | AC | 222 ms | 8064 KB |
18.txt | AC | 222 ms | 8064 KB |
19.txt | AC | 238 ms | 7808 KB |
20.txt | AC | 230 ms | 7808 KB |
21.txt | AC | 232 ms | 7808 KB |
22.txt | AC | 235 ms | 7808 KB |
23.txt | AC | 235 ms | 7808 KB |
24.txt | AC | 239 ms | 7808 KB |
25.txt | AC | 8 ms | 5760 KB |
26.txt | AC | 8 ms | 5760 KB |
27.txt | AC | 8 ms | 5760 KB |
28.txt | AC | 8 ms | 5760 KB |
sample_01.txt | AC | 8 ms | 5760 KB |
sample_02.txt | AC | 7 ms | 5760 KB |
sample_03.txt | AC | 7 ms | 5760 KB |