結果

問題 No.156 キャンディー・ボックス
ユーザー kotatsugamekotatsugame
提出日時 2016-10-30 12:01:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 151 bytes
コンパイル時間 1,653 ms
コンパイル使用メモリ 168,376 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-03 19:47:16
合計ジャッジ時間 2,250 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
5,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1 ms
5,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1 ms
5,376 KB
testcase_15 WA -
testcase_16 AC 2 ms
5,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1 ms
5,376 KB
testcase_20 WA -
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 1 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);}
      | ^~~~

ソースコード

diff #

#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);}
0