제출 #379819

#제출 시각아이디문제언어결과실행 시간메모리
379819ponytail곤돌라 (IOI14_gondola)C++17
20 / 100
43 ms5228 KiB
#include "bits/stdc++.h" #include "gondola.h" using namespace std; const int MOD = 1e9 + 9; // remember to long long int valid(int n,int inputSeq[]){ int cnt=0; set<int>s; for(int i=0;i<n;i++) s.insert(inputSeq[i]); for(int i=0;i<n;i++)cnt+=(inputSeq[i]>=1&&inputSeq[i]<=n); if(s.size()!=n) return 0; if(cnt==0) return 1; for(int i=0;i<n;i++){ if(inputSeq[i]>=1 && inputSeq[i]<=n){ int now=inputSeq[i]; for(int j=i;j<i+n;j++){ if(now!=inputSeq[j%n] && inputSeq[j%n]>=1 && inputSeq[j%n]<=n){ return 0; } now=now%n+1; } return 1; } } } int replacement(int n,int gondolaSeq[],int replacementSeq[]){ } int countReplacement(int n,int inputSeq[]){ }

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

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:10:16: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   10 |     if(s.size()!=n) return 0;
      |        ~~~~~~~~^~~
gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
   30 | }
      | ^
gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:7:13: warning: control reaches end of non-void function [-Wreturn-type]
    7 |     set<int>s;
      |             ^
#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...