結果

問題 No.156 キャンディー・ボックス
ユーザー kotatsugame
提出日時 2016-10-30 11:58:43
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 149 bytes
コンパイル時間 1,406 ms
コンパイル使用メモリ 168,812 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-24 23:33:58
合計ジャッジ時間 2,470 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 8 WA * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
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];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];for(i=n;--i;)std::cin>>a[i];std::sort(a,a+n);while(m>=0)m-=a[i++];printf("%d",i-1);}
0