Submission #3609274
Source Code Expand
#include <iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; int print(int x) { if (x < pow(10, 7)) cout << "00000" << x << endl; else if (x < pow(10, 8)) cout << "0000" << x << endl; else if (x < pow(10, 9)) cout << "000" << x << endl; else if (x < pow(10, 10)) cout << "00" << x << endl; else if (x < pow(10, 11)) cout << "0" << x << endl; else cout << x << endl; return 0; } int main() { int n, m, p, y, before = -1, count = 0; vector<int> v; cin >> n >> m; for (int i = 0; i < m; i++) { cin >> p >> y; v.push_back(p*pow(10, 6) + y); } p = pow(10, 6); sort(v.begin(), v.end()); for (int i = 0; i < m; i++) { if (before != v[i] / p) { print(v[i] - v[i] % p + 1); before = v[i] / p; count = 1; } else { count++; print(v[i] - v[i] % p + count); } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - ID |
User | waewae96 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 890 Byte |
Status | WA |
Exec Time | 238 ms |
Memory | 2424 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
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, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | WA | 230 ms | 2424 KB |
02.txt | WA | 222 ms | 2040 KB |
03.txt | WA | 1 ms | 256 KB |
04.txt | WA | 1 ms | 256 KB |
05.txt | WA | 233 ms | 2424 KB |
06.txt | WA | 233 ms | 2424 KB |
07.txt | WA | 3 ms | 256 KB |
08.txt | WA | 226 ms | 2296 KB |
09.txt | WA | 234 ms | 2424 KB |
10.txt | WA | 232 ms | 2424 KB |
11.txt | WA | 215 ms | 2296 KB |
12.txt | WA | 153 ms | 1784 KB |
13.txt | WA | 232 ms | 2040 KB |
14.txt | WA | 230 ms | 2424 KB |
15.txt | WA | 238 ms | 2424 KB |
16.txt | WA | 231 ms | 2424 KB |
17.txt | WA | 233 ms | 2424 KB |
18.txt | WA | 234 ms | 2424 KB |
sample_01.txt | WA | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | WA | 1 ms | 256 KB |