Submission #863926

# Submission time Handle Problem Language Result Execution time Memory
863926 2023-10-21T13:06:03 Z Huseyn123 Gondola (IOI14_gondola) C++17
20 / 100
29 ms 5484 KB
#include "gondola.h"
#include <bits/stdc++.h>
#define MAX 200001
#define INF LLONG_MAX
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define ins insert
#define ff first
#define ss second
#define gett(x,m) get<m>(x)
#define all(a) a.begin(),a.end()
#define lb(a,b) lower_bound(all(a),b)
#define ub(a,b) upper_bound(all(a),b)
#define sortv(a) sort(all(a))
#define sorta(a,sz) sort(a,a+sz)
#define inputar(a,b){\
    for(int i=0;i<b;i++){\
        cin >> a[i];\
    }\
}
#define inputvec(a,b){\
    for(int i=0;i<b;i++){\
        ll num;\
        cin >> num;\
        a.pb(num);\
    }\
}
#define outputar(a,b){\
    for(int i=0;i<b;i++){\
        cout << a[i] << " ";\
    }\
    cout << "\n";\
}
#define outputvec(a){\
    for(auto x:a){\
        cout << x << " ";\
    }\
    cout << "\n";\
}
#define reset(a,n,v){\
    for(int i=0;i<n;i++){\
        a[i]=v;\
    }\
}
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef tuple<ll,ll,ll> tll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef double db;
typedef long double ldb;
inline void USACO(string filename){
  freopen((filename+".in").c_str(),"r",stdin);
  freopen((filename+".out").c_str(),"w",stdout);
}
int valid(int n, int inputSeq[])
{
	map<int,int> b; 
	int x=-1; 
	for(int i=0;i<n;i++){
		if(inputSeq[i]<=n){
			x=i; 
		}
		b[inputSeq[i]]++; 
	}
	for(auto x:b){
		if(x.second>1){
			return 0;
		}
	}
	if(x==-1){
		return 1; 
	}
	vector<int> a; 
	a.resize(n); 
	int h1=inputSeq[x]-1; 
	for(int i=0;i<n;i++){
		a[x]=h1+1;
		x++;
		x%=n; 
		h1++; 
		h1%=n; 
	}
	for(int i=0;i<n;i++){
		if(inputSeq[i]<=n && inputSeq[i]!=a[i]){
			return 0;
		}
	}

	return 1; 
}

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

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

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

int countReplacement(int n, int inputSeq[])
{
	return -3; 
}
# 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 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 348 KB Output is correct
6 Correct 8 ms 2292 KB Output is correct
7 Correct 22 ms 3684 KB Output is correct
8 Correct 16 ms 4204 KB Output is correct
9 Correct 5 ms 1628 KB Output is correct
10 Correct 18 ms 4956 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 348 KB Output is correct
6 Correct 8 ms 2488 KB Output is correct
7 Correct 21 ms 3868 KB Output is correct
8 Correct 16 ms 4144 KB Output is correct
9 Correct 5 ms 1628 KB Output is correct
10 Correct 19 ms 4952 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 0 ms 600 KB Output is correct
13 Correct 13 ms 2368 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 29 ms 5484 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 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 -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 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 348 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -