제출 #860493

#제출 시각아이디문제언어결과실행 시간메모리
860493mychecksedad비스킷 담기 (IOI20_biscuits)C++17
9 / 100
1072 ms658144 KiB
#include<biscuits.h> #include<bits/stdc++.h> using namespace std; #define ll long long int #define MOD (1000000000+7) #define MOD1 (998244353) #define pb push_back #define all(x) x.begin(), x.end() #define en cout << '\n' const int N = 1e6+100, M = 1e5+10, K = 22; ll count_tastiness(ll x, vector<ll> a){ vector<ll> p; p.pb(0); ll ans = 1; for(int i = 0; i < 100; ++i) a.pb(0); int n = a.size(); for(int i = 0; i < n; ++i){ ans += int(p.size()) - (lower_bound(all(p), x - a[i]) - p.begin()); vector<ll> np, np2; for(auto y: p){ np.pb((y+a[i])>>1); if(y+a[i]-x >= 0) np2.pb((y+a[i]-x)>>1); } p.clear(); merge(all(np), all(np2), back_inserter(p)); // for(auto f: p) cout << f << ' '; // en; // cout << ans << '\n'; } return ans; }
#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...