Submission #286246

# Submission time Handle Problem Language Result Execution time Memory
286246 2020-08-30T08:46:54 Z mohammad Mechanical Doll (IOI18_doll) C++14
16 / 100
115 ms 11732 KB
#include "doll.h"
#include<bits/stdc++.h>
using namespace std;
 
#define endl "\n"
// #define int long long

typedef long long ll ;
const ll ooo = 1e14 ;
const ll oo = 2e9 ;
const double PI = acos(-1) ;
const ll M = 1e9 + 7  ;
const int N = 10000010  ;

int use[100010];
vector<int> v[100010];

void create_circuit(int M, vector<int> A) {
	int N = A.size();
	vector<int> c(M + 1 , 0);
	for(int i = 0 ; i < N ; ++i){
		if(!i)v[0].push_back(A[i]);
		else v[A[i - 1]].push_back(A[i]);
	}
	v[A[N - 1]].push_back(0);
	vector<int> x , y;
	int co = -1;
	for(int i = 0 ;  i < M + 1  ; ++i){
		if(!v[i].size()) continue ;
		// cout << i << ' ' << v[i].size() << endl;
		if(v[i].size() == 1){
			c[i] = v[i][0];
		}else if(v[i].size() == 2){
			c[i] = co--;
			x.push_back(v[i][0]);
			y.push_back(v[i][1]);
		}else if(v[i].size() == 3){
			c[i] = co--;
			x.push_back(co--);
			y.push_back(co);
			x.push_back(v[i][0]);
			y.push_back(v[i][1]);
			x.push_back(co + 2);
			y.push_back(v[i][2]);
			co--;
		}else{
			c[i] = co--;
			x.push_back(co--);
			y.push_back(co--);
			x.push_back(v[i][0]);
			y.push_back(v[i][2]);
			x.push_back(v[i][1]);
			y.push_back(v[i][3]);
		}
		// cout << c[i] << endl;
	}
	answer(c, x, y);
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 2636 KB Output is correct
2 Correct 31 ms 6372 KB Output is correct
3 Correct 29 ms 6000 KB Output is correct
4 Correct 3 ms 2636 KB Output is correct
5 Correct 13 ms 3788 KB Output is correct
6 Correct 49 ms 7620 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 2636 KB Output is correct
2 Correct 31 ms 6372 KB Output is correct
3 Correct 29 ms 6000 KB Output is correct
4 Correct 3 ms 2636 KB Output is correct
5 Correct 13 ms 3788 KB Output is correct
6 Correct 49 ms 7620 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
8 Correct 60 ms 8028 KB Output is correct
9 Correct 57 ms 8640 KB Output is correct
10 Correct 88 ms 10972 KB Output is correct
11 Correct 2 ms 2636 KB Output is correct
12 Correct 3 ms 2636 KB Output is correct
13 Correct 2 ms 2636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 2636 KB Output is correct
2 Correct 31 ms 6372 KB Output is correct
3 Correct 29 ms 6000 KB Output is correct
4 Correct 3 ms 2636 KB Output is correct
5 Correct 13 ms 3788 KB Output is correct
6 Correct 49 ms 7620 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
8 Correct 60 ms 8028 KB Output is correct
9 Correct 57 ms 8640 KB Output is correct
10 Correct 88 ms 10972 KB Output is correct
11 Correct 2 ms 2636 KB Output is correct
12 Correct 3 ms 2636 KB Output is correct
13 Correct 2 ms 2636 KB Output is correct
14 Correct 105 ms 11732 KB Output is correct
15 Correct 60 ms 7352 KB Output is correct
16 Correct 94 ms 9796 KB Output is correct
17 Correct 4 ms 2636 KB Output is correct
18 Correct 3 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 115 ms 11152 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2636 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2636 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2636 KB wrong motion
2 Halted 0 ms 0 KB -