CSES - Harjoituskisa 7.1.2018 - Results
Submission details
Task:Lista
Sender:ollpu
Submission time:2018-01-07 19:01:24 +0200
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.05 s1details
#20.05 s1details
#30.05 s1details
#40.04 s1details
#50.05 s1details
#60.05 s1details
#70.04 s1details
#80.04 s1details
#90.04 s1details
#100.05 s1details
#110.04 s2details
#120.04 s2details
#130.03 s2details
#140.05 s2details
#150.04 s2details
#160.05 s2details
#170.06 s2details
#180.04 s2details
#190.04 s2details
#200.04 s2details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:9:21: warning: 'n' may be used uninitialized in this function [-Wmaybe-uninitialized]
   for (int i = 1; i <= n; ++i) {
                     ^

Code

#include <iostream>
#include <deque>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  deque<int> r;
  for (int i = 1; i <= n; ++i) {
    if (i%2) r.push_front(i);
    else r.push_back(i);
  }
  for (int i : r) cout << i << " ";
  cout << endl;
}

Test details

Test 1

Group: 1

Verdict:

input
1

correct output

user output
(empty)

Test 2

Group: 1

Verdict:

input
2

correct output
1 2 

user output
(empty)

Test 3

Group: 1

Verdict:

input
3

correct output
3 1 2 

user output
(empty)

Test 4

Group: 1

Verdict:

input
4

correct output
3 1 2 4 

user output
(empty)

Test 5

Group: 1

Verdict:

input
5

correct output
5 3 1 2 4 

user output
(empty)

Test 6

Group: 1

Verdict:

input
10

correct output
9 7 5 3 1 2 4 6 8 10 

user output
(empty)

Test 7

Group: 1

Verdict:

input
20

correct output
19 17 15 13 11 9 7 5 3 1 2 4 6...

user output
(empty)

Test 8

Group: 1

Verdict:

input
98

correct output
97 95 93 91 89 87 85 83 81 79 ...

user output
(empty)

Test 9

Group: 1

Verdict:

input
99

correct output
99 97 95 93 91 89 87 85 83 81 ...

user output
(empty)

Test 10

Group: 1

Verdict:

input
100

correct output
99 97 95 93 91 89 87 85 83 81 ...

user output
(empty)

Test 11

Group: 2

Verdict:

input
1

correct output

user output
(empty)

Test 12

Group: 2

Verdict:

input
2

correct output
1 2 

user output
(empty)

Test 13

Group: 2

Verdict:

input
3

correct output
3 1 2 

user output
(empty)

Test 14

Group: 2

Verdict:

input
4

correct output
3 1 2 4 

user output
(empty)

Test 15

Group: 2

Verdict:

input
5

correct output
5 3 1 2 4 

user output
(empty)

Test 16

Group: 2

Verdict:

input
123456

correct output
123455 123453 123451 123449 12...

user output
(empty)

Test 17

Group: 2

Verdict:

input
666666

correct output
666665 666663 666661 666659 66...

user output
(empty)

Test 18

Group: 2

Verdict:

input
999998

correct output
999997 999995 999993 999991 99...

user output
(empty)

Test 19

Group: 2

Verdict:

input
999999

correct output
999999 999997 999995 999993 99...

user output
(empty)

Test 20

Group: 2

Verdict:

input
1000000

correct output
999999 999997 999995 999993 99...

user output
(empty)