Submission #1026275

# Submission time Handle Problem Language Result Execution time Memory
1026275 2024-07-17T18:46:43 Z MarwenElarbi Gondola (IOI14_gondola) C++17
10 / 100
9 ms 2392 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[])
{
    for (int i = 0; i < n; ++i)
    {
        if(inputSeq[i]<=n){
            tab.pb({inputSeq[i],i});
        }
    }
    bool test=true;
    bool nabba=false;
    for (int i = 1; i < tab.size(); ++i)
    {
        if(tab[i].fi<tab[i-1].fi){
            if(nabba) test=false;
            nabba=true;
            if(tab[i].fi>tab[i].se-tab[i-1].se) 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:20:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for (int i = 1; i < tab.size(); ++i)
      |                     ~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 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 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 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 348 KB Output is correct
6 Correct 3 ms 1492 KB Output is correct
7 Correct 7 ms 2392 KB Output is correct
8 Correct 6 ms 2260 KB Output is correct
9 Correct 2 ms 860 KB Output is correct
10 Correct 6 ms 2216 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 4 ms 1456 KB Output is correct
7 Correct 7 ms 2260 KB Output is correct
8 Correct 5 ms 2188 KB Output is correct
9 Correct 3 ms 936 KB Output is correct
10 Correct 9 ms 2260 KB Output is correct
11 Incorrect 0 ms 348 KB Output isn't correct
12 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 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 440 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 448 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 348 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -