Problem | lunchbox |
---|---|
User | Damen |
Submission Time | 2023-12-13 23:01:16 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
lunchbox.cpp:1:10: error: #include expects "FILENAME" or <FILENAME>
1 | #include
| ^
lunchbox.cpp:2:1: error: expected unqualified-id before ‘<’ token
2 | <bits/stdc++.h>
| ^
lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:5:12: error: ‘intmax_t’ was not declared in this scope
5 | int main(){intmax_t N;cin>>N;int m;cin>>m;intmax_t k[m];for(int i=0;i<m;i++){cin>>k[i];}sort(k,k+m);int ans=0;for(int i=0;(N>=0)&&(i<m);N-=k[i],i++,ans++){}cout<<(N<0?(--ans):(ans));return 0;}
| ^~~~~~~~
lunchbox.cpp:5:23: error: ‘cin’ was not declared in this scope
5 | int main(){intmax_t N;cin>>N;int m;cin>>m;intmax_t k[m];for(int i=0;i<m;i++){cin>>k[i];}sort(k,k+m);int ans=0;for(int i=0;(N>=0)&&(i<m);N-=k[i],i++,ans++){}cout<<(N<0?(--ans):(ans));return 0;}
| ^~~
lunchbox.cpp:5:28: error: ‘N’ was n