Submission #652661


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
typedef long long int64;

int toWin[] = {0, 3, 1, 2};
int toLose[] = {0, 2, 3, 1};

int R[100000], H[100000], Sum[100002];
int Proc[100001];
int C[100000][4];

int main()
{
  int N;
  cin >> N;


  for(int i = 0; i < N; i++) {
    cin >> R[i] >> H[i];
    Sum[R[i]]++;
    ++C[R[i]][H[i]];
    Proc[R[i]]++;
  }
  for(int i = 100000; i >= 0; i--) {
    Sum[i] += Sum[i + 1];
  }

  for(int i = 0; i < N; i++) {
    int lose = Sum[R[i] + 1];
    int win = N - lose - Proc[R[i]];
    lose += C[R[i]][toWin[H[i]]];
    win += C[R[i]][toLose[H[i]]];
    cout << win << " " << lose << " " << N - win - lose - 1 << endl;
  }

}

Submission Info

Submission Time
Task B - AtCoderでじゃんけんを
User ei13333
Language C++ (GCC 4.9.2)
Score 0
Code Size 703 Byte
Status
Exec Time 465 ms
Memory 3996 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 0 / 100 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
Case Name Status Exec Time Memory
01.txt 394 ms 3880 KB
02.txt 383 ms 3996 KB
03.txt 404 ms 1964 KB
04.txt 415 ms 1952 KB
05.txt 387 ms 1944 KB
06.txt 392 ms 1956 KB
07.txt 412 ms 1956 KB
08.txt 401 ms 1948 KB
09.txt 352 ms 1956 KB
10.txt 390 ms 1956 KB
11.txt 376 ms 3872 KB
12.txt 410 ms 3868 KB
13.txt 412 ms 3880 KB
14.txt 440 ms 1964 KB
15.txt 431 ms 1952 KB
16.txt 435 ms 1888 KB
17.txt 414 ms 1952 KB
18.txt 422 ms 1944 KB
19.txt 438 ms 3868 KB
20.txt 446 ms 3876 KB
21.txt 465 ms 3876 KB
22.txt 422 ms 3872 KB
23.txt 398 ms 3872 KB
24.txt 423 ms 3876 KB
25.txt 28 ms 1188 KB
26.txt 28 ms 1304 KB
27.txt 27 ms 1192 KB
28.txt 28 ms 1180 KB
sample_01.txt 29 ms 1312 KB
sample_02.txt 27 ms 1188 KB
sample_03.txt 28 ms 1192 KB