제출 #164984

#제출 시각아이디문제언어결과실행 시간메모리
164984kostia244Gondola (IOI14_gondola)C++17
컴파일 에러
0 ms0 KiB
#include "gondola.h" #include<bits/stdc++.h> #define pb push_back using namespace std; using ll = long long; using vi = vector<int>; int valid(int n, int a[]) { vi v, b; int x = n+1; for(int i = 0; i < n; i++) { if(a[i]<=n) v.pb(a[i]), x = min(x, a[i]); else b.pb(a[i]); } sort(all(b)); for(int i =1;i<b.size();i++)if(b[i]==b[i-1]) return 0; if(v.size()<2) return 1; int i = 0; while(v[i] != x) v.pb(v[i++]); for(++i; i < v.size(); i++) { if(v[i]<=v[i-1]) return 0; } return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }

컴파일 시 표준 에러 (stderr) 메시지

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:17:7: error: 'all' was not declared in this scope
  sort(all(b));
       ^~~
gondola.cpp:17:7: note: suggested alternative: 'll'
  sort(all(b));
       ^~~
       ll
gondola.cpp:18:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i =1;i<b.size();i++)if(b[i]==b[i-1]) return 0;
               ~^~~~~~~~~
gondola.cpp:23:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(++i; i < v.size(); i++) {
           ~~^~~~~~~~~~