답안 #1041751

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1041751 2024-08-02T07:45:36 Z 김은성(#11000) A Light Inconvenience (CEOI23_light) C++17
0 / 100
556 ms 1048576 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;
	for(ll i=cnt; i>=1; i-=5)
		ret.push_back(i);
	if(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(5*p, ret);
}

std::pair<long long, std::vector<long long>> leave(long long p){
	ch = 1;
	cnt -= p;
	vector<ll> ret;
	for(ll i=cnt; i>=1; i-=5)
		ret.push_back(i);
	if(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);
}

Compilation message

light.cpp: In function 'std::pair<long long int, std::vector<long long int> > join(long long int)':
light.cpp:19:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for(int i=0; i<ret.size()/2; i++)
      |               ~^~~~~~~~~~~~~
light.cpp: In function 'std::pair<long long int, std::vector<long long int> > leave(long long int)':
light.cpp:32:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |  for(int i=0; i<ret.size()/2; i++)
      |               ~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 542 ms 1048576 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 4 ms 468 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 4 ms 468 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 4 ms 468 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 4 ms 468 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 4 ms 468 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 344 KB Partially correct
2 Runtime error 556 ms 1048576 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -