Task: | Merkkijono |
Sender: | Yytsi |
Submission time: | 2018-01-18 15:40:07 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.04 s | details |
#2 | WRONG ANSWER | 0.04 s | details |
#3 | WRONG ANSWER | 0.04 s | details |
#4 | WRONG ANSWER | 0.05 s | details |
#5 | WRONG ANSWER | 0.04 s | details |
Code
#include <iostream> #include <utility> using namespace std; #define N 100001 int p[N]; pair<int, int> inp[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; cin.ignore(); int k = (n / 2) + 1; for (int i = 0; i < k; i++) { int a, b; cin >> a >> b; cin.ignore(); p[a]++; p[b]++; inp[i] = make_pair(a, b); } for (int i = 0; i < k; i++) { pair<int,int> L = inp[i]; int a = L.first,b=L.second; p[a]--; p[b]--; if (p[a] == 1 || p[b] == 1) { cout << a <<" " << b; break; } } return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
ABCDEFGHIJKLMNOPQRSTUVWXYZ |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 2
Verdict: WRONG ANSWER
input |
---|
ZYXWVUTSRQPONMLKJIHGFEDCBA |
correct output |
---|
923 MOVE MOVE SWAP MOVE ... |
user output |
---|
(empty) |
Test 3
Verdict: WRONG ANSWER
input |
---|
RPJMFWBHYQOTXUAENLDGZISCVK |
correct output |
---|
611 SWAP MOVE MOVE SWAP ... |
user output |
---|
(empty) |
Test 4
Verdict: WRONG ANSWER
input |
---|
GWJSPBHANMXYFLKIDORVUCEZQT |
correct output |
---|
659 MOVE SWAP MOVE SWAP ... |
user output |
---|
(empty) |
Test 5
Verdict: WRONG ANSWER
input |
---|
BJYNFLKEIUCZMQHRAXOGWPSDTV |
correct output |
---|
624 MOVE SWAP MOVE SWAP ... |
user output |
---|
(empty) |