제출 #134877

#제출 시각아이디문제언어결과실행 시간메모리
134877miguelKitchen (BOI19_kitchen)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define rc(x) return cout<<x<<endl,0 #define pb push_back #define dbg(x) cout << #x << '=' << x << '\n'; #define ll long long #define sz size() #define x first #define y second #define pi pair <int, int> #define pii pair <int, pi> #define vi vector <int> const ll mod = 998244353; nt n, m, k, s; int a[605], b[605], dp[2][1000001]; int32_t main(){ ios_base :: sync_with_stdio(0); cin.tie(); cout.tie(); cin>>n>>m>>k; //if(m<k) return cout<<"Impossible", 0; for(int i=1; i<=n; i++){ cin>>a[i]; s+=a[i]; if(a[i]<k) return cout<<"Impossible", 0; } for(int i=1; i<=m; i++) cin>>b[i]; dp[0][0]=0; //int cur=0; for(int i=1; i<=m; i++){ for(int h=0; h<=nmax*nmax; h++){ dp[1][h+b[i]]=max(dp[0][h+b[i]], dp[0][h]+min(b[i], n)); } //cur+=b[i]; for(int h=0; h<=nmax*nmax; h++) dp[0][h]=dp[1][h]; } //cout<<"xd"; for(int h=s; h<=nmax*nmax; h++){ //cout<<h<<" "<<dp[0][h]<<endl; if(dp[0][h]>=n*k) return cout<<h-s, 0; } cout<<"Impossible"; }

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

kitchen.cpp:14:1: error: 'nt' does not name a type; did you mean 'int'?
 nt n, m, k, s;
 ^~
 int
kitchen.cpp: In function 'int32_t main()':
kitchen.cpp:19:10: error: 'n' was not declared in this scope
     cin>>n>>m>>k;
          ^
kitchen.cpp:19:13: error: 'm' was not declared in this scope
     cin>>n>>m>>k;
             ^
kitchen.cpp:19:16: error: 'k' was not declared in this scope
     cin>>n>>m>>k;
                ^
kitchen.cpp:23:9: error: 's' was not declared in this scope
         s+=a[i];
         ^
kitchen.cpp:30:25: error: 'nmax' was not declared in this scope
         for(int h=0; h<=nmax*nmax; h++){
                         ^~~~
kitchen.cpp:30:25: note: suggested alternative: 'fmax'
         for(int h=0; h<=nmax*nmax; h++){
                         ^~~~
                         fmax
kitchen.cpp:34:25: error: 'nmax' was not declared in this scope
         for(int h=0; h<=nmax*nmax; h++) dp[0][h]=dp[1][h];
                         ^~~~
kitchen.cpp:34:25: note: suggested alternative: 'fmax'
         for(int h=0; h<=nmax*nmax; h++) dp[0][h]=dp[1][h];
                         ^~~~
                         fmax
kitchen.cpp:37:15: error: 's' was not declared in this scope
     for(int h=s; h<=nmax*nmax; h++){
               ^
kitchen.cpp:37:21: error: 'nmax' was not declared in this scope
     for(int h=s; h<=nmax*nmax; h++){
                     ^~~~
kitchen.cpp:37:21: note: suggested alternative: 'fmax'
     for(int h=s; h<=nmax*nmax; h++){
                     ^~~~
                     fmax