#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
typedef int INT;
#define mp make_pair
#define pb push_back
#define fst first
#define snd second
#define int long long
#define MMAX 16384
#define fast_io() ios::sync_with_stdio(false)
#define FOR(i, l, r) for(int i = (l); i < (r); i++)
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef set<int> si;
typedef double ld;
typedef pair<ld, ld> dd;
const ll INF = 1000000000000000000LL;
const int NMAX = 1e5+4;
const int mod = 1e9+7;
const ld eps = 1e-10;
const ld PI = acos(-1);
INT valid(INT n, INT inputSeq[]){
int k = -1;
FOR(i, 0, n) if(inputSeq[i] <= n) {k = i; break;}
if(k == -1) {
sort(inputSeq, inputSeq+n);
FOR(i, 0, n-1) if(inputSeq[i] == inputSeq[i+1]) return false;
return true;
}
int pos = (k-inputSeq[k]+1+n)%n;
rotate(inputSeq, inputSeq+pos, inputSeq+n);
FOR(i, 0, n){
if(inputSeq[i] <= n and inputSeq[i] != i+1) return false;
}
return true;
}
INT replacement(INT n, INT gondolaSeq[], INT replacementSeq[]){
}
INT countReplacement(INT n, INT inputSeq[]){
}
/*
signed main(){
int n;
INT seq[NMAX];
cin >> n;
FOR(i, 0, n) cin >> seq[i];
cout << valid(n, seq) << endl;
fast_io();
}*/
Compilation message
gondola.cpp: In function 'INT replacement(INT, INT*, INT*)':
gondola.cpp:49:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
gondola.cpp: In function 'INT countReplacement(INT, INT*)':
gondola.cpp:53:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
492 KB |
Output is correct |
3 |
Correct |
2 ms |
492 KB |
Output is correct |
4 |
Correct |
3 ms |
492 KB |
Output is correct |
5 |
Correct |
2 ms |
508 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
580 KB |
Output is correct |
2 |
Correct |
3 ms |
592 KB |
Output is correct |
3 |
Correct |
3 ms |
596 KB |
Output is correct |
4 |
Correct |
2 ms |
600 KB |
Output is correct |
5 |
Correct |
4 ms |
756 KB |
Output is correct |
6 |
Correct |
8 ms |
912 KB |
Output is correct |
7 |
Correct |
19 ms |
1636 KB |
Output is correct |
8 |
Correct |
22 ms |
2012 KB |
Output is correct |
9 |
Correct |
8 ms |
2012 KB |
Output is correct |
10 |
Correct |
22 ms |
2672 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2672 KB |
Output is correct |
2 |
Correct |
3 ms |
2672 KB |
Output is correct |
3 |
Correct |
2 ms |
2672 KB |
Output is correct |
4 |
Correct |
3 ms |
2672 KB |
Output is correct |
5 |
Correct |
2 ms |
2672 KB |
Output is correct |
6 |
Correct |
8 ms |
2680 KB |
Output is correct |
7 |
Correct |
18 ms |
3556 KB |
Output is correct |
8 |
Correct |
22 ms |
3780 KB |
Output is correct |
9 |
Correct |
7 ms |
3780 KB |
Output is correct |
10 |
Correct |
13 ms |
4440 KB |
Output is correct |
11 |
Incorrect |
3 ms |
4440 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
4440 KB |
Integer 0 violates the range [1, 76] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
4440 KB |
Integer 0 violates the range [1, 76] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
4440 KB |
Integer 0 violates the range [1, 76] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
4440 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
4440 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
4440 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
4440 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |