제출 #1256464

#제출 시각아이디문제언어결과실행 시간메모리
1256464pandaa73Souvenirs (IOI25_souvenirs)C++20
22 / 100
0 ms412 KiB
#include <bits/stdc++.h> using namespace std; #define lf "\n" #define ff endl #define _ << ' ' << #define all(x) begin(x),end(x) #define rall(x) rbegin(x),rend(x) #define infos(str) do { fprintf(stderr, str"\n"); } while(0) #define infor(str, ...) do { fprintf(stderr, str, __VA_ARGS__); } while(0) #define infof(str, ...) do { fprintf(stderr, str"\n", __VA_ARGS__); } while(0) #ifndef DEBUG #undef infos #undef infor #undef infof #define infos(str) #define infor(str, ...) #define infof(str, ...) #endif using ll = long long; constexpr int LOG = 20; constexpr int MOD = 1e9+7; constexpr int MAXN = 1e5+7; std::pair<std::vector<int>, long long> transaction(long long M); void buy_souvenirs(int N, long long P0) { if(N == 2) return (void)(transaction(P0 - 1)); assert(N == 3); auto [q, x] = transaction(P0 - 1); ll pay = P0 - 1 - x; if(q.size() == 1) { transaction(pay - 1); transaction(pay - 1); return; } transaction((pay - 1) / 2); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...