제출 #338319

#제출 시각아이디문제언어결과실행 시간메모리
338319mayflyyh비스킷 담기 (IOI20_biscuits)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#define ll long long
ll dp[70];
ll b[70];
ll count_tastiness(ll x, ll[] a){
	int end=65;
	for(int i=0;i<=end;++i)
		if(a[i]) b[i]=a[i];
		else b[i]=0;
	for(int i=end;i+1;--i){
		if(i==end){
			dp[i]=1;
		}
		else{
			for(int j=end;j>=i+1;--j){
				ll min=0,max=(1<<end-i)-1;
				ll ai=0;
				for(int k=j-1;k>=i;--k){
					ai=ai*2+b[i];
					ll y_=0;
					if(k>i){
						y_=(ai/x+1)<<(k-i);
						if(y_>min)
							min=y_;
					}
					else{
						y_=ai/x;
						if(y_<max)
							max=y_; 
					}
				}
			}
		}
	}
	return dp[0];
}

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

biscuits.cpp:5:31: error: expected ',' or '...' before 'a'
    5 | ll count_tastiness(ll x, ll[] a){
      |                               ^
biscuits.cpp: In function 'long long int count_tastiness(long long int, long long int*)':
biscuits.cpp:8:6: error: 'a' was not declared in this scope
    8 |   if(a[i]) b[i]=a[i];
      |      ^
biscuits.cpp:16:25: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   16 |     ll min=0,max=(1<<end-i)-1;
      |                      ~~~^~