Submission #1153574

#TimeUsernameProblemLanguageResultExecution timeMemory
1153574zhasynGondola (IOI14_gondola)C++20
Compilation error
0 ms0 KiB
#include "gondola.h"
#include <bits/stdc++.h>
#define pb push_back
#define pf push_front
using namespace std;
#define F first
#define S second
typedef long long ll;
#define pii pair <int, int>
#define pll pair <ll, ll>
typedef long double ld;
const ll N = 3 * 1e5 + 100, M = 1e7 + 10, len = 21, inf = 1e18;
const ll mod = 998244353;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll um(ll a, ll b){
	return (1LL * a * b) % mod;
}
ll subr(ll a, ll b){
	return ((1LL * a - b) % mod + mod) % mod;
}

int valid(int n, int arr[])
{
  int cur = 0;
  for(int i = 0; i < 2 * n; i++){
  	cur = cur%n + 1;
  	if(was){
  		if(arr[i] > n) continue;
  		if(arr[i] != cur) return 0;
  	} else{
  		if(arr[i] <= n){
  			was = true;
  			cur = arr[i];
  		}
  	}
  }
  return 1;
}

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

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

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

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


// int main() {
  // ios::sync_with_stdio(false);
  // cin.tie(NULL);
//   
  // return 0;
// }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:27:12: error: 'was' was not declared in this scope
   27 |         if(was){
      |            ^~~