Submission #3533365


Source Code Expand

Copy
// beetに勝つ

#include <bits/stdc++.h>

using namespace std;

using int64 = long long;

int main() {
  int N, M, P[100000], Q[100000];
  cin >> N >> M;
  map< int, vector< int > > mp;
  for(int i = 0; i < M; i++) {
    cin >> P[i] >> Q[i];
    mp[P[i]].emplace_back(Q[i]);
  }
  for(auto &p : mp) {
    sort(begin(p.second), end(p.second), [&](int a, int b) {
      return a < b;
    });
  }
  for(int i = 0; i < M; i++) {
    auto it = lower_bound(begin(mp[P[i]]), end(mp[P[i]]), Q[i]) - begin(mp[P[i]]);
    printf("%06d%06d\n", P[i], (int) (it + 1));
  }
}

Submission Info

Submission Time
Task C - ID
User ei13333
Language C++14 (GCC 5.4.1)
Score 300
Code Size 592 Byte
Status
Exec Time 177 ms
Memory 13184 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 300 / 300 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, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt 171 ms 9216 KB
02.txt 95 ms 2808 KB
03.txt 1 ms 256 KB
04.txt 1 ms 256 KB
05.txt 107 ms 2808 KB
06.txt 177 ms 13184 KB
07.txt 2 ms 384 KB
08.txt 135 ms 3968 KB
09.txt 168 ms 9216 KB
10.txt 106 ms 2744 KB
11.txt 109 ms 2816 KB
12.txt 74 ms 2048 KB
13.txt 110 ms 2816 KB
14.txt 168 ms 9216 KB
15.txt 169 ms 9216 KB
16.txt 170 ms 9216 KB
17.txt 168 ms 9216 KB
18.txt 169 ms 9216 KB
sample_01.txt 1 ms 256 KB
sample_02.txt 1 ms 256 KB
sample_03.txt 1 ms 256 KB