제출 #429133

#제출 시각아이디문제언어결과실행 시간메모리
429133abdzag비스킷 담기 (IOI20_biscuits)C++17
0 / 100
990 ms368 KiB
#include<bits/stdc++.h> #include<unordered_map> #include<unordered_set> #include "biscuits.h" #define rep(i,a,b) for(int i=int(a);i<int(b);i++) #define rrep(i,a,b) for(int i=int(a);i>int(b);i--) #define trav(a,v) for(auto& a: v) #define sz(v) v.size() #define all(v) v.begin(),v.end() #define vi vector<int> typedef long long ll; typedef long double ld; typedef unsigned long long ull; const long long inf = 2e9; using namespace std; long long count_tastiness(long long x, std::vector<long long> a) { ll ans = 1; vector<ll> cur; rep(i, 1, 1e5 + 1) { cur = a; bool done = true; rep(j, 0, 18) { if (!((1 << j) & i))continue; if (j >= a.size()) { done = false; break; } rrep(o, j - 1, -1) { if (cur[j] >= x)break; if((1<<o)&i)cur[j] += (cur[o] - x) / (1 << (j - o)); else cur[j] += (cur[o]) / (1 << (j - o)); } if (cur[j] < x) { done = false; break; } } ans += done; } return ans; } //int main() { // ll q; // cin >> q; // rep(i, 0, q) { // ll n, x; // cin >> n >> x; // vector<ll> v(n); // rep(i, 0, n)cin >> v[i]; // cout << count_tastiness(x, v) << endl; // } //}

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:27:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |    if (j >= a.size()) {
      |        ~~^~~~~~~~~~~
#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...