Submission #10228064
Source Code Expand
#include<bits/stdc++.h> #include<unordered_set> #include<unordered_map> using namespace std; #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define all(a) a.begin(),a.end() #define rall(c) (c).rbegin(),(c).rend() #define mp make_pair typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef long double ld; const ll inf=1e9+7; const ll mod=998244353; int main(){ ll n;cin>>n; vector<ll>a(100010); vector<vector<ll> >b(100010,vector<ll>(3)); vector<pll>x(n); rep(i,n){ ll r,h;cin>>r>>h; h--; x[i]=mp(r,h); a[r]++; b[r][h]++; } REP(i,1,100001){ a[i]=a[i]+a[i-1]; } rep(i,n){ ll r=x[i].first,h=x[i].second; ll w=0,l=0; w+=a[r-1]; l+=n-a[r]; w+=b[r][(h+1)%3]; l+=b[r][(h+2)%3]; cout<<w<<' '<<l<<' '<<n-1-w-l<<endl; } }
Submission Info
Submission Time | |
---|---|
Task | B - AtCoderでじゃんけんを |
User | auaua |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 969 Byte |
Status | AC |
Exec Time | 250 ms |
Memory | 9856 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 | 242 ms | 9344 KB |
02.txt | AC | 245 ms | 9472 KB |
03.txt | AC | 217 ms | 9472 KB |
04.txt | AC | 217 ms | 9472 KB |
05.txt | AC | 212 ms | 9728 KB |
06.txt | AC | 212 ms | 9728 KB |
07.txt | AC | 210 ms | 9856 KB |
08.txt | AC | 214 ms | 9856 KB |
09.txt | AC | 210 ms | 9856 KB |
10.txt | AC | 212 ms | 9856 KB |
11.txt | AC | 224 ms | 9344 KB |
12.txt | AC | 226 ms | 9344 KB |
13.txt | AC | 226 ms | 9344 KB |
14.txt | AC | 227 ms | 9088 KB |
15.txt | AC | 225 ms | 9088 KB |
16.txt | AC | 226 ms | 9088 KB |
17.txt | AC | 226 ms | 9600 KB |
18.txt | AC | 225 ms | 9600 KB |
19.txt | AC | 241 ms | 9472 KB |
20.txt | AC | 234 ms | 9344 KB |
21.txt | AC | 239 ms | 9472 KB |
22.txt | AC | 240 ms | 9344 KB |
23.txt | AC | 250 ms | 9344 KB |
24.txt | AC | 236 ms | 9344 KB |
25.txt | AC | 8 ms | 6528 KB |
26.txt | AC | 8 ms | 6528 KB |
27.txt | AC | 8 ms | 6528 KB |
28.txt | AC | 8 ms | 6528 KB |
sample_01.txt | AC | 8 ms | 6528 KB |
sample_02.txt | AC | 8 ms | 6528 KB |
sample_03.txt | AC | 8 ms | 6528 KB |