제출 #389193

#제출 시각아이디문제언어결과실행 시간메모리
389193Pichon5곤돌라 (IOI14_gondola)C++17
20 / 100
40 ms4564 KiB
#include "gondola.h" #include<bits/stdc++.h> #define vi vector<int> #define pb push_back #define F first #define S second using namespace std; int valid(int n, int v[]) { int pos1=0; set<int>st; for(int i=0;i<n;i++){ if(v[i]<=n){ int B=v[i]-1; if(i-B>=0){ pos1=i-B; }else{ B-=i; pos1=n-B; } } if(v[i]<=0)return 0; st.insert(v[i]); } if(st.size()!=n)return 0; int pos=pos1; for(int i=1;i<=n;i++){ if(v[i]>n)continue; if(v[pos]!=i)return 0; pos++; if(pos==n)pos=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:25:17: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   25 |     if(st.size()!=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...