제출 #304613

#제출 시각아이디문제언어결과실행 시간메모리
304613medmdg비스킷 담기 (IOI20_biscuits)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; long long int count_tastiness(long long int x,long long int[] a){ long long int b[61]; int k=61; bool an[k]; memset(b,0,61); for(int i=0;i<a.size();i++) b[i]=a[i]; memset(an,false,k); for(int i=0;i<61;i++){ if(b[i]>=x){ an[i]=true; b[i]-=x; }else{ an[i]=false; } b[i+1]+=b[i]/2; b[i]=0; } unsigned long long int ans=0; for(int i=0;i<61;i++){ if(an[i]) ans+=1<<i; } return ans; }

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

biscuits.cpp:4:63: error: expected ',' or '...' before 'a'
    4 | long long int count_tastiness(long long int x,long long int[] a){
      |                                                               ^
biscuits.cpp: In function 'long long int count_tastiness(long long int, long long int*)':
biscuits.cpp:8:18: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
    8 |     memset(b,0,61);
      |                  ^
biscuits.cpp:9:19: error: 'a' was not declared in this scope
    9 |     for(int i=0;i<a.size();i++)
      |                   ^