結果
| 問題 | No.156 キャンディー・ボックス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-30 12:01:22 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 151 bytes |
| 記録 | |
| コンパイル時間 | 1,272 ms |
| コンパイル使用メモリ | 183,112 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-19 04:48:34 |
| 合計ジャッジ時間 | 2,754 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 7 WA * 23 |
コンパイルメッセージ
main.cpp:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){int n,m,i;std::cin>>n>>m;int a[n+1];for(i=n;--i;)std::cin>>a[i];std::sort(a,a+n);while(m>=0)m-=a[i++];printf("%d",i-1);}
| ^~~~
ソースコード
#include<bits/stdc++.h>
main(){int n,m,i;std::cin>>n>>m;int a[n+1];for(i=n;--i;)std::cin>>a[i];std::sort(a,a+n);while(m>=0)m-=a[i++];printf("%d",i-1);}