제출 #307375

#제출 시각아이디문제언어결과실행 시간메모리
307375arthur_nascimento비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1092 ms896 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define debug #define maxn 64 unordered_map<ll,ll> mp[64]; ll v[maxn]; int n; ll X; ll get(int pos,ll xt){ //if(mp[pos].find(xt) != mp[pos].end()) // return mp[pos][xt]; ll ans = 0; if(pos == n-1){ debug("%d %lld rets %lld\n",pos,xt,1+(xt + v[pos])/X); return 1+(xt + v[pos])/X; } int ok = 0; ll cur = v[pos]+xt; if(cur >= X) ok = 1; for(int i=pos+1;i<n && ok == 0;i++){ cur /= 2; cur += v[i]; if(cur >= X) ok = 1; } if(ok == 0) return 0; ans = get(pos+1,(xt+v[pos])/2); if(v[pos]+xt >= X) ans += get(pos+1, (xt+v[pos]-X)/2); debug("%d %lld rets %lld\n",pos,xt,ans); return ans; } long long count_tastiness(long long x, std::vector<long long> a) { X = x; for(int i=0;i<64;i++) mp[i].clear(), v[i] = a[i]; n = a.size(); debug("n %d, x %lld : ",n,x); for(ll i : a) debug("%lld ",i); debug("\n"); return get(0,0); }

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

biscuits.cpp: In function 'll get(int, ll)':
biscuits.cpp:18:9: warning: left operand of comma operator has no effect [-Wunused-value]
   18 |   debug("%d %lld rets %lld\n",pos,xt,1+(xt + v[pos])/X);
      |         ^~~~~~~~~~~~~~~~~~~~~
biscuits.cpp:18:35: warning: right operand of comma operator has no effect [-Wunused-value]
   18 |   debug("%d %lld rets %lld\n",pos,xt,1+(xt + v[pos])/X);
      |                                   ^~
biscuits.cpp:18:54: warning: right operand of comma operator has no effect [-Wunused-value]
   18 |   debug("%d %lld rets %lld\n",pos,xt,1+(xt + v[pos])/X);
      |                                                      ^
biscuits.cpp:36:8: warning: left operand of comma operator has no effect [-Wunused-value]
   36 |  debug("%d %lld rets %lld\n",pos,xt,ans);
      |        ^~~~~~~~~~~~~~~~~~~~~
biscuits.cpp:36:34: warning: right operand of comma operator has no effect [-Wunused-value]
   36 |  debug("%d %lld rets %lld\n",pos,xt,ans);
      |                                  ^~
biscuits.cpp:36:37: warning: right operand of comma operator has no effect [-Wunused-value]
   36 |  debug("%d %lld rets %lld\n",pos,xt,ans);
      |                                     ^~~
biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:47:8: warning: left operand of comma operator has no effect [-Wunused-value]
   47 |  debug("n %d, x %lld : ",n,x); for(ll i : a) debug("%lld ",i); debug("\n");
      |        ^~~~~~~~~~~~~~~~~
biscuits.cpp:47:28: warning: right operand of comma operator has no effect [-Wunused-value]
   47 |  debug("n %d, x %lld : ",n,x); for(ll i : a) debug("%lld ",i); debug("\n");
      |                            ^
biscuits.cpp:47:52: warning: left operand of comma operator has no effect [-Wunused-value]
   47 |  debug("n %d, x %lld : ",n,x); for(ll i : a) debug("%lld ",i); debug("\n");
      |                                                    ^~~~~~~
biscuits.cpp:47:70: warning: statement has no effect [-Wunused-value]
   47 |  debug("n %d, x %lld : ",n,x); for(ll i : a) debug("%lld ",i); debug("\n");
      |                                                                     ~^~~~~
#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...