제출 #339974

#제출 시각아이디문제언어결과실행 시간메모리
339974bigDuck곤돌라 (IOI14_gondola)C++14
10 / 100
12 ms2024 KiB
#include "gondola.h" #include<bits/stdc++.h> using namespace std; #define INIT ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #define mp make_pair #define pb push_back #define ft first #define sc second #define ll long long #define pii pair<int, int> #define count_bits __builtin_popcount int mod=((int)1e9)+9; int cnt_valid[250010]; int valid(int n, int inputSeq[]) { vector<int> v; for(int i=0; i<n; i++){ if(cnt_valid[inputSeq[i]]>0 ){ return 0; } cnt_valid[inputSeq[i] ]++; if(inputSeq[i]<=n){ v.pb(inputSeq[i]); } } int ls=0; for(int i=0; i<v.size(); i++){ if(i>0){ if(v[i]<v[i-1]){ls++;} } if(ls>1){ return 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:31:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     for(int i=0; i<v.size(); i++){
      |                  ~^~~~~~~~~
#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...