Submission #1041494

# Submission time Handle Problem Language Result Execution time Memory
1041494 2024-08-02T04:49:38 Z 김은성(#11000) A Light Inconvenience (CEOI23_light) C++17
5 / 100
261 ms 596 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 248 ms 344 KB Correct
3 Correct 245 ms 344 KB Correct
4 Correct 261 ms 344 KB Correct
5 Correct 219 ms 344 KB Correct
6 Correct 237 ms 344 KB Correct
7 Correct 260 ms 428 KB Correct
8 Correct 237 ms 344 KB Correct
9 Correct 252 ms 344 KB Correct
10 Correct 227 ms 344 KB Correct
11 Correct 243 ms 344 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 1 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 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 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 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 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Correct
2 Correct 226 ms 428 KB Correct
3 Correct 217 ms 344 KB Correct
4 Correct 219 ms 596 KB Correct
5 Correct 232 ms 344 KB Correct
6 Correct 246 ms 340 KB Correct
7 Correct 261 ms 344 KB Correct
8 Correct 230 ms 344 KB Correct
9 Correct 239 ms 344 KB Correct
10 Correct 241 ms 344 KB Correct
11 Correct 231 ms 344 KB Correct
12 Incorrect 1 ms 596 KB Not correct
13 Halted 0 ms 0 KB -