답안 #1073121

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1073121 2024-08-24T09:43:16 Z edogawa_something A Light Inconvenience (CEOI23_light) C++17
0 / 100
1 ms 344 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;
	vector<long long>ans;
	for(auto it:v)
		ans.push_back(cnt-it+1);
		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-p);
	}
	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;
	vector<long long>ans;
	for(auto it:v)
		ans.push_back(cnt-it+1);
	return {p,v};
}

Compilation message

light.cpp: In function 'std::pair<long long int, std::vector<long long int> > join(long long int)':
light.cpp:34:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   34 |  for(auto it:v)
      |  ^~~
light.cpp:36:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   36 |   return {p,v};
      |   ^~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 1 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 0 ms 344 KB Not correct
3 Halted 0 ms 0 KB -