Submission #1165891

#TimeUsernameProblemLanguageResultExecution timeMemory
1165891RED1Treasure (IOI24_treasure)C++20
0 / 100
0 ms844 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define Algerian ios::sync_with_stdio(false); #define OI cin.tie(nullptr); map<pair<ll,ll>,vector<pair<int, int>>> mp; vector<pair<int, int>> decode(vector<int> S){ ll x1 = 0, x2 = 0; bool x1d = false; for(auto i : S){ if(i==0){ x1d = true; continue; } if(!x1d) x1 += i; else x2 += i; } return mp[{x1,x2}]; } vector<int> encode(vector<pair<int, int>> P){ ll x1 = 0, x2 = 0; for(auto i : P){ x1 += i.first; x2+=i.second; } mp[{x1,x2}] = P; vector<int> a; while(x1>0){ a.push_back(x1-min(2000000000LL,x1)); x1 -= min(2000000000LL,x1); } a.push_back(0); while(x2>0){ a.push_back(x2-min(2000000000LL,x2)); x2 -= min(2000000000LL,x2); } return a; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...