제출 #125228

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1252282019-07-04 21:24:00khulegub곤돌라 (IOI14_gondola)C++14
컴파일 에러
0 ms0 KiB
#include "gondola.h"
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define xx first
#define yy second
using namespace std;
typedef long long i64;
typedef pair<int, int> pii;
const i64 MOD = 1e9 + 7;
int valid(int n, int arr[]){
vector<pii> rep;
vector<pii> v;
for (int i = 0; i < n; i++){
arr[i]--;
// cout << arr[i] << ' ';
if (arr[i] >= n){
rep.pb(mp(arr[i] - n, i) );
}
else v.pb(mp(i, arr[i]) );
}
if(v.size() > 0){
int diff = v[0].yy - v[0].xx;
int end = (n - 1) - diff;
int diff2 = diff - n;
// cout << diff2;
int vn = v.size();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:41:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i + 1 < rep.size(); i++){
                 ~~~~~~^~~~~~~~~~~~
gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:68:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < rep.size(); i++){
                  ~~^~~~~~~~~~~~
gondola.cpp:90:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < rep.size(); i++){
                  ~~^~~~~~~~~~~~
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:118:15: error: 'inputSeq' was not declared in this scope
  if(!valid(n, inputSeq)) return 0; //sha
               ^~~~~~~~
gondola.cpp:124:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if(rep.size() == n) res = rep.size();
     ~~~~~~~~~~~^~~~
gondola.cpp:129:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < rep.size(); i++) {
                  ~~^~~~~~~~~~~~