제출 #132142

#제출 시각아이디문제언어결과실행 시간메모리
132142miguel곤돌라 (IOI14_gondola)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include<gondola.h> using namespace std; #define rc(x) return cout<<x<<endl,0 #define pb push_back #define dbg(x) cout << #x << '=' << x << '\n'; #define ll long long #define int ll #define sz size() #define x first #define y second #define pi pair <int, int> #define pii pair <int, pi> #define vi vector <int> const ll mod = 998244353; int n; int nxt(int lol, int n){ if(lol<n-1) return lol+1; else return 0; } int nxtg(int lol, int n){ if(lol==n) return 1; else return (lol+1); } bool valid(int n, vector <int> v){ int cnt[250001]; memset(cnt, 0, sizeof cnt); int mn=250001, mx=0, br=0, idx; for(int i=0; i<n; i++){ if(mn>v[i]){ mn=v[i]; idx=i; } mx=max(mx, v[i]); } int xd=idx; if(v[xd]<=n && v[xd]!=mn+((xd-idx+n)%n)) return 0; cnt[v[xd]]++; xd=nxt(xd, n); while(xd!=idx){ if(v[xd]<=n && v[xd]!=mn+((xd-idx+n)%n)) return 0; cnt[v[xd]]++; xd=nxt(xd, n); } for(int i=1; i<=n; i++){ if(cnt[i]>1) return 0; } for(int i=n+1; i<=mx; i++){ if(cnt[i]!=1) return 0; } return 1; }

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

gondola.cpp: In function 'bool valid(long long int, std::vector<long long int>)':
gondola.cpp:31:26: warning: unused variable 'br' [-Wunused-variable]
     int mn=250001, mx=0, br=0, idx;
                          ^~
gondola.cpp:43:13: warning: 'idx' may be used uninitialized in this function [-Wmaybe-uninitialized]
     while(xd!=idx){
           ~~^~~~~
/tmp/ccEBILxC.o: In function `main':
grader.cpp:(.text.startup+0xc3): undefined reference to `countReplacement'
grader.cpp:(.text.startup+0xe2): undefined reference to `valid'
grader.cpp:(.text.startup+0x106): undefined reference to `replacement'
collect2: error: ld returned 1 exit status