Submission #45309941
Source Code Expand
use proconio::input;
fn main() {
input! {
_n: usize,
m: usize,
py: [(usize, usize); m],
};
let mut ipy = py
.iter()
.copied()
.enumerate()
.map(|(i, (p, y))| (i, p, y))
.collect::<Vec<_>>();
ipy.sort_by_key(|&(_, p, y)| (p, y));
let mut prev = 0;
let mut count = 1;
let mut ans = vec![];
for (i, p, _) in ipy {
if prev != p {
count = 1;
}
ans.push((i, format!("{:06}{:06}", p, count)));
prev = p;
count += 1;
}
ans.sort_by_key(|&(i, _)| i);
for (_, a) in ans {
println!("{}", a);
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - ID |
| User | bouzuya |
| Language | Rust (rustc 1.70.0) |
| Score | 300 |
| Code Size | 657 Byte |
| Status | AC |
| Exec Time | 128 ms |
| Memory | 13728 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 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 | AC | 125 ms | 13580 KiB |
| 02.txt | AC | 125 ms | 13116 KiB |
| 03.txt | AC | 1 ms | 2000 KiB |
| 04.txt | AC | 0 ms | 1856 KiB |
| 05.txt | AC | 127 ms | 13728 KiB |
| 06.txt | AC | 125 ms | 13556 KiB |
| 07.txt | AC | 2 ms | 1960 KiB |
| 08.txt | AC | 125 ms | 13256 KiB |
| 09.txt | AC | 128 ms | 13680 KiB |
| 10.txt | AC | 124 ms | 13624 KiB |
| 11.txt | AC | 115 ms | 12592 KiB |
| 12.txt | AC | 82 ms | 9612 KiB |
| 13.txt | AC | 125 ms | 13360 KiB |
| 14.txt | AC | 128 ms | 13548 KiB |
| 15.txt | AC | 128 ms | 13656 KiB |
| 16.txt | AC | 125 ms | 13564 KiB |
| 17.txt | AC | 125 ms | 13608 KiB |
| 18.txt | AC | 126 ms | 13700 KiB |
| sample_01.txt | AC | 1 ms | 2120 KiB |
| sample_02.txt | AC | 1 ms | 1912 KiB |
| sample_03.txt | AC | 1 ms | 2052 KiB |