Submission #1041595

# Submission time Handle Problem Language Result Execution time Memory
1041595 2024-08-02T06:03:14 Z 김은성(#11000) A Light Inconvenience (CEOI23_light) C++17
5 / 100
290 ms 432 KB
#include "light.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool ch;
ll cnt;
void prepare(){
	ch = 0;
	cnt = 1;
}

std::pair<long long, std::vector<long long>> join(long long p){
	cnt += p;
	vector<ll> ret;
	if(ch){
		return make_pair(p, vector<long long>({cnt}));
	}
	for(long long po = 1; po <= cnt; po *= 2)
		ret.push_back(cnt+1-po);
	if(ret.empty() || ret.back() != 1)
		ret.push_back(1);
	for(int i=0; i<ret.size()/2; i++)
		swap(ret[i], ret[ret.size()-1-i]);
	return make_pair(p, ret);
}

std::pair<long long, std::vector<long long>> leave(long long p){
	ch = 1;
	cnt -= p;
	return make_pair(p, vector<long long>({cnt}));
}

Compilation message

light.cpp: In function 'std::pair<long long int, std::vector<long long int> > join(long long int)':
light.cpp:22:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |  for(int i=0; i<ret.size()/2; i++)
      |               ~^~~~~~~~~~~~~
# 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 Correct 240 ms 432 KB Correct
3 Correct 256 ms 344 KB Correct
4 Correct 250 ms 344 KB Correct
5 Correct 258 ms 344 KB Correct
6 Correct 224 ms 344 KB Correct
7 Correct 290 ms 344 KB Correct
8 Correct 243 ms 344 KB Correct
9 Correct 230 ms 344 KB Correct
10 Correct 206 ms 344 KB Correct
11 Correct 233 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 1 ms 340 KB Correct
2 Correct 256 ms 428 KB Correct
3 Correct 234 ms 344 KB Correct
4 Correct 245 ms 344 KB Correct
5 Correct 268 ms 344 KB Correct
6 Correct 211 ms 344 KB Correct
7 Correct 224 ms 344 KB Correct
8 Correct 220 ms 340 KB Correct
9 Correct 247 ms 344 KB Correct
10 Correct 236 ms 344 KB Correct
11 Correct 264 ms 344 KB Correct
12 Incorrect 0 ms 344 KB Not correct
13 Halted 0 ms 0 KB -