제출 #588993

#제출 시각아이디문제언어결과실행 시간메모리
588993FatihSolak곤돌라 (IOI14_gondola)C++17
20 / 100
83 ms9228 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std; int valid(int n, int inputSeq[]){ set<int> s; map<int,int> pos; for(int i = 0;i<n;i++){ s.insert(inputSeq[i]); pos[inputSeq[i]] = i; } if(s.size() != n || *s.rbegin() - *s.begin() + 1 != n)return 0; int num = *s.begin() + 1; while(num <= n){ if(pos[num] != (pos[num-1] + 1)%n){ return 0; } num++; } 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:11:14: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   11 |  if(s.size() != n || *s.rbegin() - *s.begin() + 1 != n)return 0;
      |     ~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...