Submission #426900

# Submission time Handle Problem Language Result Execution time Memory
426900 2021-06-14T10:47:02 Z SAAD Gondola (IOI14_gondola) C++17
10 / 100
18 ms 1740 KB
#define F first
#define S second
#define rep(i,a,b) for(int i=a;!(a==b&&i!=b)&&((i<=b&&b>=a)||(i>=b&&a>=b));i+=(a<=b?1:-1))
#define pb push_back
#define Fbitl __builtin_ffs
#define bit1 __builtin_popcount
#define pi acos(-1)
//#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include "gondola.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<vl> vvl;
bool visa[(int)1e5];
int valid(int n, int inputSeq[]) {
    vii x(n);
    bool th = true;
    for (int i = 0;i < n;i++) {
        x[i] = {inputSeq[i],i} ;
    }
    sort(x.begin(),x.end());
    for (int i = 0;i<x.size()-1;i++) {
        if (x[i].F > n) continue;
        if ( x[i].F == x[i+1].F - 1 && (x[i].S+1)%n != x[i+1].S )
            return 0;
    }
    return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[]) {
  return 0;
}
int countReplacement(int n, int inputSeq[]) {
  return 0;
}

Compilation message

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:36:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |     for (int i = 0;i<x.size()-1;i++) {
      |                    ~^~~~~~~~~~~
gondola.cpp:31:10: warning: unused variable 'th' [-Wunused-variable]
   31 |     bool th = true;
      |          ^~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 276 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 7 ms 952 KB Output is correct
7 Correct 18 ms 1740 KB Output is correct
8 Correct 11 ms 1440 KB Output is correct
9 Correct 5 ms 588 KB Output is correct
10 Correct 16 ms 1740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 7 ms 844 KB Output is correct
7 Correct 18 ms 1740 KB Output is correct
8 Correct 11 ms 1484 KB Output is correct
9 Correct 6 ms 756 KB Output is correct
10 Correct 15 ms 1716 KB Output is correct
11 Incorrect 1 ms 204 KB Output isn't correct
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 236 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -