Submission #139252

# Submission time Handle Problem Language Result Execution time Memory
139252 2019-07-31T13:29:46 Z wilwxk Mechanical Doll (IOI18_doll) C++14
0 / 100
61 ms 4872 KB
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;

const int MAXN=2e5+5;
vector<int> c, x, y;
int n, respf;

void debug() {
  for(auto cur : c) printf("%d ", cur); cout << endl;
  for(auto cur : x) printf("%d ", cur); cout << endl;
  for(auto cur : y) printf("%d ", cur); cout << endl;
}

void create_circuit(int M, std::vector<int> A) {
  n=A.size(); respf=1;
  if(n==1) {
    c.push_back(1);
    c.push_back(0);
    answer(c, x, y);
    return;
  }

  c.push_back(1);
  c.push_back(-1);
  for(int i=1; i<=n-1; i++) {
    if(i==1) x.push_back(1);
    else x.push_back(-i+1);
    y.push_back(-i-1);
  }
  y.back()=0;

  
  answer(c, x, y);
}

Compilation message

doll.cpp: In function 'void debug()':
doll.cpp:10:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   10 |   for(auto cur : c) printf("%d ", cur); cout << endl;
      |   ^~~
doll.cpp:10:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   10 |   for(auto cur : c) printf("%d ", cur); cout << endl;
      |                                         ^~~~
doll.cpp:11:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   11 |   for(auto cur : x) printf("%d ", cur); cout << endl;
      |   ^~~
doll.cpp:11:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   11 |   for(auto cur : x) printf("%d ", cur); cout << endl;
      |                                         ^~~~
doll.cpp:12:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   12 |   for(auto cur : y) printf("%d ", cur); cout << endl;
      |   ^~~
doll.cpp:12:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   12 |   for(auto cur : y) printf("%d ", cur); cout << endl;
      |                                         ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Wrong Answer: wrong array length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Wrong Answer: wrong array length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Wrong Answer: wrong array length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Wrong Answer: wrong array length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 224 KB Output is correct
2 Incorrect 61 ms 4872 KB over 20000000 inversions
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 224 KB Output is correct
2 Incorrect 61 ms 4872 KB over 20000000 inversions
3 Halted 0 ms 0 KB -