Submission #40385
ソースコード
ステータス
項目 |
データ |
問題 |
0238 - ナップザック問題(Easy) |
ユーザー名 |
ei1821
|
投稿日時 |
2018-07-31 23:41:37 |
言語 |
C++11 |
状態 |
Compile Error |
得点 |
0
|
ソースコード長 |
491 Byte |
最大実行時間 |
-
|
最大メモリ使用量 |
|
コンパイルメッセージ
./Main.cpp:4:9: error: ‘pair’ does not name a type
typedef pair<int,int> pii;
^~~~
./Main.cpp: In function ‘int main()’:
./Main.cpp:10:3: error: ‘cin’ was not declared in this scope
cin.tie(0), ios::sync_with_stdio(false);
^~~
./Main.cpp:10:3: note: suggested alternative: ‘main’
cin.tie(0), ios::sync_with_stdio(false);
^~~
main
./Main.cpp:10:15: error: ‘ios’ has not been declared
cin.tie(0), ios::sync_with_stdio(false);
^~~
./Main.cpp:12:7: error: ‘i’ was not declared in this scope
FOR(i,n) cin >>v[i]>>w[i];
^
./Main.cpp:12:3: error: ‘FOR’ was not declared in this scope
FOR(i,n) cin >>v[i]>>w[i];
^~~
./Main.cpp:13:3: error: ‘cout’ was not declared in this scope
cout <<dfs(0,W)<<endl;
^~~~
./Main.cpp:13:20: error: ‘endl’ was not declared in this scope
cout <<dfs(0,W)<<endl;
^~~~
./Main.cpp:13:20: note: suggested alternative: ‘enum’
cout <<dfs(0,W)<<endl;
^~~~
enum
./Main.cpp: In function ‘int dfs(int, int)’:
./Main.cpp:22:15: error: ‘max’ was not declared in this scope
else return max(dfs(i,j-w[i])+v[i] , dfs(i+1,j));
^~~
./Main.cpp:22:15: note: suggested alternative: ‘main’
else return max(dfs(i,j-w[i])+v[i] , dfs(i+1,j));
^~~
main
セット
テストケース