Submission #124867

# Submission time Handle Problem Language Result Execution time Memory
124867 2019-07-04T04:55:35 Z khulegub Gondola (IOI14_gondola) C++14
0 / 100
2 ms 376 KB
#include "gondola.h"
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define xx first
#define yy second
using namespace std;
typedef long long i64;
typedef pair<int, int> pii;




int valid(int n, int arr[]){
	vector<pii> rep;
	vector<pii> v;
	for (int i = 0; i < n; i++){
		arr[i]--;
		// cout << arr[i] << ' ';
		if (arr[i] >= n){
			rep.pb(mp(i, arr[i] - n) );
		}
		else v.pb(mp(i, arr[i]) );
	}
	if(v.size() > 0){
		int diff = v[0].yy - v[0].xx;
		int end = (n - 1) + diff;
		int diff2 = n + diff;
		int vn = v.size();
		for (int i = 0; i < vn; i++){
			if (v[i].xx <= end){
				if (v[i].yy - v[i].xx != diff) return 0;
			}
			else{
				if (v[i].yy - v[i].xx != diff2) return 0;
			}
		}
	}
	// cout << "veve";
	return 1;
}
//----------------------

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

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

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


// int main(){
// 	freopen("in.txt", "r", stdin);
// 	int n;
// 	int arr[1000];
// 	cin >> n;
// 	for(int i = 0; i < n; i++){
// 		cin >> arr[i];
// 	}
// 	valid(n, arr);
// }


# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 252 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -