Submission #56505574
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> count(N+1,0); // 個数をカウント
for(int i=0; i<2*N-1; i++) {
int num;
cin >> num;
count.at(num)++;
}
for(int i=1; i<=N; i++) {
// countが2ならペアが存在.1ならペアがないから2Nの番号
if (count.at(i) == 1) {
cout << i << endl;
break;
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | D - 二人三脚 (Three-Legged Race) |
| User | strkgr |
| Language | C++ 20 (gcc 12.2) |
| Score | 100 |
| Code Size | 474 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3544 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample-01.txt, sample-02.txt, sample-03.txt |
| All | 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, sample-01.txt, sample-02.txt, sample-03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01-01.txt | AC | 1 ms | 3444 KiB |
| 01-02.txt | AC | 1 ms | 3472 KiB |
| 01-03.txt | AC | 1 ms | 3408 KiB |
| 01-04.txt | AC | 1 ms | 3444 KiB |
| 01-05.txt | AC | 1 ms | 3544 KiB |
| 01-06.txt | AC | 1 ms | 3528 KiB |
| 01-07.txt | AC | 1 ms | 3408 KiB |
| 01-08.txt | AC | 1 ms | 3496 KiB |
| sample-01.txt | AC | 1 ms | 3440 KiB |
| sample-02.txt | AC | 1 ms | 3448 KiB |
| sample-03.txt | AC | 1 ms | 3456 KiB |