Task: | Just do it |
Sender: | Orangutans |
Submission time: | 2024-11-16 14:59:34 +0200 |
Language: | C++ (C++17) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.00 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | WRONG ANSWER | 0.00 s | details |
#11 | WRONG ANSWER | 0.00 s | details |
#12 | WRONG ANSWER | 0.00 s | details |
#13 | WRONG ANSWER | 0.00 s | details |
#14 | WRONG ANSWER | 0.00 s | details |
#15 | WRONG ANSWER | 0.00 s | details |
#16 | WRONG ANSWER | 0.00 s | details |
#17 | WRONG ANSWER | 0.00 s | details |
Code
// Sort an array. Initialize with low = 0 and high = len(array) #include <vector> #include <string> #include <iostream> #include <cmath> using namespace std; int main(){ int n; cin >> n; int aux = 1; for (int i = 0; i < n/2; ++i) { cout << aux; cout << " "; aux +=2; } if (n%2 == 1) cout << aux << " "; aux = 2; for (int i = 0; i < n/2; ++i) { cout << aux; if (i != n/2 -1) cout << " "; aux +=2; } cout << endl; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
2 |
correct output |
---|
1 2 |
user output |
---|
1 2 |
Test 2
Verdict: ACCEPTED
input |
---|
3 |
correct output |
---|
1 2 3 |
user output |
---|
1 3 2 |
Test 3
Verdict: ACCEPTED
input |
---|
4 |
correct output |
---|
1 2 3 4 |
user output |
---|
1 3 2 4 |
Test 4
Verdict: ACCEPTED
input |
---|
5 |
correct output |
---|
1 2 4 3 5 |
user output |
---|
1 3 5 2 4 |
Test 5
Verdict: ACCEPTED
input |
---|
6 |
correct output |
---|
1 2 3 5 4 6 |
user output |
---|
1 3 5 2 4 6 |
Test 6
Verdict: ACCEPTED
input |
---|
7 |
correct output |
---|
1 2 4 6 5 3 7 |
user output |
---|
1 3 5 7 2 4 6 |
Test 7
Verdict: ACCEPTED
input |
---|
8 |
correct output |
---|
1 2 3 5 7 6 4 8 |
user output |
---|
1 3 5 7 2 4 6 8 |
Test 8
Verdict: ACCEPTED
input |
---|
9 |
correct output |
---|
1 2 4 6 8 3 7 5 9 |
user output |
---|
1 3 5 7 9 2 4 6 8 |
Test 9
Verdict: ACCEPTED
input |
---|
10 |
correct output |
---|
1 2 3 5 7 9 4 8 6 10 |
user output |
---|
1 3 5 7 9 2 4 6 8 10 |
Test 10
Verdict: WRONG ANSWER
input |
---|
99 |
correct output |
---|
1 2 4 6 8 10 12 14 16 18 20 22... |
user output |
---|
1 3 5 7 9 11 13 15 17 19 21 23... |
Test 11
Verdict: WRONG ANSWER
input |
---|
100 |
correct output |
---|
1 2 3 5 7 9 11 13 15 17 19 21 ... |
user output |
---|
1 3 5 7 9 11 13 15 17 19 21 23... |
Test 12
Verdict: WRONG ANSWER
input |
---|
101 |
correct output |
---|
1 2 4 6 8 10 12 14 16 18 20 22... |
user output |
---|
1 3 5 7 9 11 13 15 17 19 21 23... |
Test 13
Verdict: WRONG ANSWER
input |
---|
300 |
correct output |
---|
1 2 3 5 7 9 11 13 15 17 19 21 ... |
user output |
---|
1 3 5 7 9 11 13 15 17 19 21 23... |
Test 14
Verdict: WRONG ANSWER
input |
---|
500 |
correct output |
---|
1 2 3 5 7 9 11 13 15 17 19 21 ... |
user output |
---|
1 3 5 7 9 11 13 15 17 19 21 23... |
Test 15
Verdict: WRONG ANSWER
input |
---|
998 |
correct output |
---|
1 2 3 5 7 9 11 13 15 17 19 21 ... |
user output |
---|
1 3 5 7 9 11 13 15 17 19 21 23... |
Test 16
Verdict: WRONG ANSWER
input |
---|
999 |
correct output |
---|
1 2 4 6 8 10 12 14 16 18 20 22... |
user output |
---|
1 3 5 7 9 11 13 15 17 19 21 23... |
Test 17
Verdict: WRONG ANSWER
input |
---|
1000 |
correct output |
---|
1 2 3 5 7 9 11 13 15 17 19 21 ... |
user output |
---|
1 3 5 7 9 11 13 15 17 19 21 23... |