제출 #297805

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2978052020-09-12 01:14:39juckter곤돌라 (IOI14_gondola)C++14
100 / 100
75 ms5112 KiB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXV = 3e5 + 10;
const ll MOD = 1e9 + 9;
ll mpow(ll b, ll e) {
ll res = 1;
for(ll k = 1; k <= e; k *= 2) {
if(k & e) res = (res * b) % MOD;
b = (b * b) % MOD;
}
return res;
}
int valid(int n, int inputSeq[]) {
set<int> seen;
int rot = -1;
for(int i = 0; i < n; i++) {
if(seen.count(inputSeq[i]))
return 0;
seen.insert(inputSeq[i]);
if(inputSeq[i] <= n) {
int nr = (inputSeq[i] - i + n) % n;
if(rot != -1 && rot != nr)
return 0;
rot = nr;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:88:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   88 |     for(int i = 1; i < bigs.size(); i++) {
      |                    ~~^~~~~~~~~~~~~
gondola.cpp:84:8: warning: unused variable 'cntSmall' [-Wunused-variable]
   84 |     ll cntSmall = n - cntBig;
      |        ^~~~~~~~
gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:45:44: warning: 'rot' may be used uninitialized in this function [-Wmaybe-uninitialized]
   45 |         rotate(gondolaSeq, gondolaSeq + (n - rot) % n, gondolaSeq + n);
      |                                         ~~~^~~~~~
#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...