| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1363448 | hollow_breeze | 선물 (IOI25_souvenirs) | C++20 | 8 ms | 344 KiB |
#include "souvenirs.h"
#include <utility>
#include <vector>
#include <iostream>
using namespace std;
void buy_souvenirs(int N, long long P0)
{
long long i,cnt,j,ant,fol;
pair<vector<int>, long long> res;
if(N==2)
{
res = transaction(P0-1);
return ;
}
else if(N==3)
{
res = transaction(P0-1);
if(res.first.size()==1)
{
cnt=P0-1-res.second;
transaction(cnt-1);
transaction(cnt-1);
}
else
{
cnt=P0-1-res.second;
if(cnt%2==0)
cnt=cnt/2+1;
else
cnt=(cnt+1)/2;
transaction(cnt-1);
}
return ;
}
fol=0;
ant=P0;
for(i=1;i<N;i++)
{
if(i<N-1)
{
res = transaction(ant-1);
if(res.first.size()==2)
{
fol++;
res.second++;
}
cnt = ant-1-res.second;
for(j=0;j<i-1;j++)
transaction(cnt);
ant=cnt;
}
else
{
for(j=0;j<i-fol;j++)
transaction(ant-1);
}
}
return ;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
