Submission #1073100

# Submission time Handle Problem Language Result Execution time Memory
1073100 2024-08-24T09:31:04 Z edogawa_something A Light Inconvenience (CEOI23_light) C++17
0 / 100
1 ms 428 KB
#include "light.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
int cnt;
vector<long long>v;
void prepare(){
	cnt = 1;
	v.push_back(1);
}

std::pair<long long, std::vector<long long>> join(long long p){
		cnt+=p;
		vector<long long> vv;
		vv.push_back(1);
		for(auto &it:v)
		it+=p;
		for(long long i=1;1;) {
			long long res=1;
			for(auto it:v) {
				if((2ll*i+p)>=it)
					res=max(res,min(it,2ll*i));
			}
			if(res>=cnt) {
				vv.push_back(cnt);
				break;
			}
			else
				vv.push_back(res);
			i=res;
		}
		v=vv;
		return {p,v};
}

std::pair<long long, std::vector<long long>> leave(long long p){
	cnt-=p;
	vector<long long> vv,vvv;
	vvv=v;
	v.clear();
	for(auto it:vvv) {
		if(it-p>0)
			v.push_back(it);
	}
	vv.push_back(1);
	for(long long i=1;1;) {
		long long res=1;
		for(auto it:v) {
			if((2ll*i+p)>=it)
				res=max(res,min(it,2ll*i));
		}
		if(res>=cnt) {
			vv.push_back(cnt);
			break;
		}
		else
			vv.push_back(res);
		i=res;
	}
	v=vv;
	return {p,v};
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Correct
2 Incorrect 0 ms 428 KB Not correct
3 Halted 0 ms 0 KB -