제출 #595045

#제출 시각아이디문제언어결과실행 시간메모리
595045MadokaMagicaFan비스킷 담기 (IOI20_biscuits)C++14
0 / 100
3 ms316 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using pi = pair<int,int>; #define all(v) v.begin(),v.end() #define sort(v) sort(all(v)) #define endl '\n' #define forn(i,n) for(int i = 0; i < n; ++i) #define forbe(i,b,e) for(int i = b; i < e; ++i) #define forr(i,n) for(int i = n-1; i >= 0; --i) #define sz(v) ((int)v.size()) #define pb push_back #define f first #define s second ll count_tastiness(ll x, vector<ll> a){ int k = sz(a); ll ans = 0; int mval = 100000; ll rem; int t; forbe(i,0, mval+1) { if (i >= (1ll<<(k+1))) break; ++ans; rem = 0; t = 1; forn(j, 25) { rem >>= 1; if (j < k) rem += a[j]; // cout << i << ' ' << j << ' ' << rem << endl; if ((((i>>j)^1)&1)) continue; // cout << i << endl; if (rem < x) { t = 0; --ans; // cout << i << endl; break; } rem -= x; } // if (t) // cout << i << endl; } return ans; } #ifdef ONPC void solve() { int k, x; cin >> k >> x; vector<ll> a(k); forn(i,k) cin >> a[i]; cout << count_tastiness(x,a) << endl; } int main() { freopen("in", "r", stdin); // ios_base::sync_with_stdio(0);cin.tie(0); solve(); } #endif

컴파일 시 표준 에러 (stderr) 메시지

biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:28:9: warning: variable 't' set but not used [-Wunused-but-set-variable]
   28 |     int t;
      |         ^
#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...