제출 #426891

#제출 시각아이디문제언어결과실행 시간메모리
426891SAAD곤돌라 (IOI14_gondola)C++17
컴파일 에러
0 ms0 KiB
#define F first #define S second #define rep(i,a,b) for(int i=a;!(a==b&&i!=b)&&((i<=b&&b>=a)||(i>=b&&a>=b));i+=(a<=b?1:-1)) #define pb push_back #define Fbitl __builtin_ffs #define bit1 __builtin_popcount #define pi acos(-1) //#include <bits/stdc++.h> #include <iostream> #include <math.h> #include <algorithm> #include <string.h> #include <vector> #include <queue> #include <map> #include <unordered_map> #include "gondola.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<string, string> pss; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<ll> vl; typedef vector<vl> vvl; bool visa[(int)1e5]; int valid(int n, int inputSeq[]) { vii x(n); bool th = true; for (int i = 0;i < n;i++) { x[i] = {inputSeq[i],i} ; } sort(x.begin(),x.end()); for (int i = 0;i<x.size()-1;i++) { if (x[i].F > n) continue; if ( x[i].F == x[i+1].F - 1 && (x[i].S+1)%n != x[i+1].S ) return 0; } return 1; }

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

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:36:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |     for (int i = 0;i<x.size()-1;i++) {
      |                    ~^~~~~~~~~~~
gondola.cpp:31:10: warning: unused variable 'th' [-Wunused-variable]
   31 |     bool th = true;
      |          ^~
/usr/bin/ld: /tmp/ccspfMx3.o: in function `main':
grader.cpp:(.text.startup+0x108): undefined reference to `countReplacement'
/usr/bin/ld: grader.cpp:(.text.startup+0x132): undefined reference to `replacement'
collect2: error: ld returned 1 exit status