| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1364206 | mar | 선물 (IOI25_souvenirs) | C++20 | 9 ms | 348 KiB |
#include <bits/stdc++.h>
#include "souvenirs.h"
using namespace std;
typedef long long ll;
const int maxn=105;
ll p[maxn];
int cnt[maxn];
void buy_souvenirs(int n, ll p0){
p[0]=p0;
for(int i=1;i<n-1;i++){
for(int j=0;j<i;j++){
if(j) transaction(p[i]);
else{
auto res=transaction(p[i-1]-1);
cnt[i]++;
if(res.first.size()==2) cnt[n-1]++;
if(res.first.size()==2 || res.second==1){
p[i]=p[i-1]-2;
}else{
p[i]=p[i-1]-1;
}
}
}
}
for(int j=0;j<n-1-cnt[n-1];j++) transaction(p[n-2]-1);
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
