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 AC
Exec Time 177 ms
Memory 13184 KB

Judge Result

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