結果

問題 No.156 キャンディー・ボックス
ユーザー chiwakii
提出日時 2015-02-26 23:58:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 294 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 61,180 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-23 21:49:29
合計ジャッジ時間 1,513 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 21 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;

int main(void)
{
	int N, M, ans=0;
	cin >> N >> M;
	vector <int> C;
	for(int i=0; i<N; i++)
	{
		int temp;
		cin >> temp;
		C.push_back(temp);
	}


	for(N=0; M>0; N++)
	{
		M-=C[N];
		if(M<0) break;
	}
cout << N << endl;
	return 0;
}
0