Submission #43781

# Submission time Handle Problem Language Result Execution time Memory
43781 2018-03-23T17:29:05 Z PowerOfNinjaGo Gondola (IOI14_gondola) C++14
20 / 100
26 ms 2020 KB
//Power Of Ninja Go
#include <bits/stdc++.h>
#ifdef atom
    #include "grader.cpp"
#else
    #include "gondola.h"
#endif
using namespace std;
typedef long long ll; typedef pair<int, int> ii;
#define X first
#define Y second
#define vi vector<int>
#define vii vector< ii >
#define pb push_back
int valid(int n, int arr[])
{
    vi vec;
    for(int i = 0; i< n; i++) vec.pb(arr[i]);
    sort(vec.begin(), vec.end()); vec.resize(unique(vec.begin(), vec.end())-vec.begin());
    if(vec.size() != n) return 0;
    for(int i = 0; i< n; i++) arr[i]--;
    vi tmp;
    for(int i = 0; i< n; i++) if(arr[i]< n) tmp.pb((arr[i]-i+n)%n);
    sort(tmp.begin(), tmp.end()); tmp.resize(unique(tmp.begin(), tmp.end())-tmp.begin());
    return (tmp.size()<= 1);
}

//----------------------

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
  return -2;
}

//----------------------

int countReplacement(int n, int inputSeq[])
{
  return -3;
}

Compilation message

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:20:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if(vec.size() != n) return 0;
                   ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 248 KB Output is correct
2 Correct 2 ms 352 KB Output is correct
3 Correct 1 ms 424 KB Output is correct
4 Correct 2 ms 496 KB Output is correct
5 Correct 1 ms 568 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 568 KB Output is correct
2 Correct 1 ms 568 KB Output is correct
3 Correct 1 ms 568 KB Output is correct
4 Correct 1 ms 604 KB Output is correct
5 Correct 1 ms 604 KB Output is correct
6 Correct 10 ms 1256 KB Output is correct
7 Correct 21 ms 1556 KB Output is correct
8 Correct 18 ms 1936 KB Output is correct
9 Correct 10 ms 1936 KB Output is correct
10 Correct 22 ms 2016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2016 KB Output is correct
2 Correct 2 ms 2016 KB Output is correct
3 Correct 1 ms 2016 KB Output is correct
4 Correct 1 ms 2016 KB Output is correct
5 Correct 1 ms 2016 KB Output is correct
6 Correct 11 ms 2016 KB Output is correct
7 Correct 21 ms 2016 KB Output is correct
8 Correct 15 ms 2016 KB Output is correct
9 Correct 6 ms 2016 KB Output is correct
10 Correct 26 ms 2020 KB Output is correct
11 Correct 1 ms 2020 KB Output is correct
12 Correct 1 ms 2020 KB Output is correct
13 Correct 9 ms 2020 KB Output is correct
14 Correct 2 ms 2020 KB Output is correct
15 Correct 26 ms 2020 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2020 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2020 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2020 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2020 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2020 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2020 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2020 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -