Submission #302613

# Submission time Handle Problem Language Result Execution time Memory
302613 2020-09-18T22:02:05 Z AlanChen Comparing Plants (IOI20_plants) C++14
0 / 100
1 ms 384 KB
#include <bits/stdc++.h>
using namespace std;

typedef vector<int> vi;

#define get4(a,b,c,d,...) d
#define lp3(x,a,b) for(int x=(a);x<(b);x++)
#define lp2(x,a) lp3(x,0,a)
#define lp1(a) lp2(loopvar,a)
#define lp(x...) get4(x,lp3,lp2,lp1,0)(x)

#define trv(x,S) for(auto& x:(S))

#define pb push_back
#define sz(S) (int)(S).size()

#include "plants.h"

const int mx=100;
int n;

int ord[mx];

void incr(int& x)
{
	x++;
	if(x==n) x=0;
}
void decr(int& x)
{
	if(x==0) x=n;
	x--;
}

void init(int k, vi r)
{
	n=sz(r);

	lp(nump,n)
	{
		int idx=0;
		while(r[idx]!=k-1) idx++;
		idx=(idx+k)%n;
		while(r[idx]!=k-1) idx++;

		r[idx]=0;
		ord[idx]=nump;
	}

	return;
}

int compare_plants(int x, int y)
{
	if(ord[x]>ord[y]) return 1;

	return -1;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 384 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -