結果
| 問題 | 
                            No.156 キャンディー・ボックス
                             | 
                    
| コンテスト | |
| ユーザー | 
                             focus
                         | 
                    
| 提出日時 | 2018-01-23 21:41:20 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 340 bytes | 
| コンパイル時間 | 568 ms | 
| コンパイル使用メモリ | 59,104 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-26 03:48:19 | 
| 合計ジャッジ時間 | 1,858 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 WA * 1 | 
| other | AC * 21 WA * 9 | 
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
    vector<long long>   vc;
    long long N,M,x,i;
    cin >> N >> M;
    for(i=0;i<N;i++){
        cin >> x;
        M-=x;
        if(M<0){
            cout << i;
            return 0;
        }
    }
    cout << i;
    return 0;
}
            
            
            
        
            
focus