답안 #289620

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
289620 2020-09-02T19:33:27 Z VROOM_VARUN Bubble Sort 2 (JOI18_bubblesort2) C++14
컴파일 오류
0 ms 0 KB
int main() {
#ifndef ONLINE_JUDGE
  freopen("bubblesort2.in", "r", stdin);
  freopen("bubblesort2.out", "w", stdout);
#endif
  cin.sync_with_stdio(0);
  cin.tie(0);

  vector<int> a;
  vector<int> inds;
  vector<int> vals;

  a = {1, 2, 3, 4};
  inds = {0, 2};
  vals = {3, 1};
  // debug("asdf");
  vector<int> pr = countScans(a, inds, vals);

  debug(pr);

  // debug(pr);

  // debug(to);

  // debug(a);
  // debug(vals);

  // debug(segtree);

  return 0;
}

Compilation message

bubblesort2.cpp: In function 'int main()':
bubblesort2.cpp:4:34: error: 'stdin' was not declared in this scope
    4 |   freopen("bubblesort2.in", "r", stdin);
      |                                  ^~~~~
bubblesort2.cpp:1:1: note: 'stdin' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
  +++ |+#include <cstdio>
    1 | 
bubblesort2.cpp:4:3: error: 'freopen' was not declared in this scope
    4 |   freopen("bubblesort2.in", "r", stdin);
      |   ^~~~~~~
bubblesort2.cpp:5:35: error: 'stdout' was not declared in this scope
    5 |   freopen("bubblesort2.out", "w", stdout);
      |                                   ^~~~~~
bubblesort2.cpp:5:35: note: 'stdout' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
bubblesort2.cpp:7:3: error: 'cin' was not declared in this scope
    7 |   cin.sync_with_stdio(0);
      |   ^~~
bubblesort2.cpp:10:3: error: 'vector' was not declared in this scope
   10 |   vector<int> a;
      |   ^~~~~~
bubblesort2.cpp:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> a;
      |          ^~~
bubblesort2.cpp:11:10: error: expected primary-expression before 'int'
   11 |   vector<int> inds;
      |          ^~~
bubblesort2.cpp:12:10: error: expected primary-expression before 'int'
   12 |   vector<int> vals;
      |          ^~~
bubblesort2.cpp:14:3: error: 'a' was not declared in this scope
   14 |   a = {1, 2, 3, 4};
      |   ^
bubblesort2.cpp:15:3: error: 'inds' was not declared in this scope
   15 |   inds = {0, 2};
      |   ^~~~
bubblesort2.cpp:16:3: error: 'vals' was not declared in this scope
   16 |   vals = {3, 1};
      |   ^~~~
bubblesort2.cpp:18:10: error: expected primary-expression before 'int'
   18 |   vector<int> pr = countScans(a, inds, vals);
      |          ^~~
bubblesort2.cpp:20:9: error: 'pr' was not declared in this scope
   20 |   debug(pr);
      |         ^~
bubblesort2.cpp:20:3: error: 'debug' was not declared in this scope
   20 |   debug(pr);
      |   ^~~~~