Submission #1026871

# Submission time Handle Problem Language Result Execution time Memory
1026871 2024-07-18T12:34:22 Z MarwenElarbi Gondola (IOI14_gondola) C++17
20 / 100
24 ms 5072 KB
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
#define pb push_back
#define se second
#define fi first
const int nax=5e5+5;
const int MOD=1e9+7;
vector<pair<int,int>> tab;
int valid(int n, int inputSeq[])
{
    bool test=true;
    set<int> stt;
    for (int i = 0; i < n; ++i)
    {
        stt.insert(inputSeq[i]);
    }
    test&=(stt.size()==n);
    int cnt=-1e9;
    for (int i = 0; i < n; ++i)
    {
        if(inputSeq[i]<=n){
            cnt=(inputSeq[i]-(i+1)+n)%n;
        }
    }
    if(cnt==-1e9) return test;
    for (int i = 0; i < n; ++i)
    {
        if(inputSeq[i]<=n){
            if((inputSeq[i]-(i+1)+n)%n!=cnt) test=false;
        }
    }
    return test;
}
 
//----------------------
 
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:18:22: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   18 |     test&=(stt.size()==n);
      |            ~~~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 7 ms 2140 KB Output is correct
7 Correct 20 ms 3752 KB Output is correct
8 Correct 13 ms 3932 KB Output is correct
9 Correct 4 ms 1372 KB Output is correct
10 Correct 17 ms 4444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 420 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 7 ms 2308 KB Output is correct
7 Correct 20 ms 3676 KB Output is correct
8 Correct 15 ms 3932 KB Output is correct
9 Correct 4 ms 1372 KB Output is correct
10 Correct 22 ms 4680 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 9 ms 2140 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 24 ms 5072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -