AtCoder Beginner Contest 032

Submission #6908368

Source codeソースコード

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    ll N, K; cin >> N >> K;
    vector<ll> s(N);
    ll mint = 1e9;
    for(int i = 0; i < N; i++){
        cin >> s[i];
        mint = min(mint, s[i]);
        if(s[i] == 0){
            cout << N << endl;
            return 0;
        }
    }
    /* if(mint > K){
        cout << 0 << endl;
        return 0;
    } */
    s.push_back(K+1);
    ll l = 0, r = 0;
    //cout << s[7] << endl;
    ll mul = 1;
    ll ans = 0;

    while(1){
        while(r < N && mul <= K){
            mul *= s[r++];
        }
        if(mul <= K) break;
        ans = min(ans, r- l);
        mul /= s[l++];
    }
    cout << ans << endl;
}

Submission

Task問題 C - 列
User nameユーザ名 raoZ
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 RE
Score得点 0
Source lengthソースコード長 738 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - subtask0_sample_01.txt,subtask0_sample_02.txt,subtask0_sample_03.txt,subtask0_sample_04.txt
Subtask1 0 / 20 subtask0_sample_01.txt,subtask0_sample_02.txt,subtask0_sample_03.txt,subtask0_sample_04.txt,subtask1_01.txt,subtask1_02.txt,subtask1_03.txt,subtask1_04.txt,subtask1_05.txt,subtask1_06.txt,subtask1_07.txt,subtask1_08.txt,subtask1_09.txt,subtask1_10.txt,subtask1_11.txt,subtask1_12.txt,subtask1_13.txt,subtask1_14.txt,subtask1_15.txt,subtask1_16.txt,subtask1_17.txt,subtask1_corner.txt,subtask1_killer1.txt,subtask1_killer2.txt,subtask1_killer3.txt,subtask1_killer4.txt,subtask1_killer5.txt
Subtask2 0 / 80 subtask0_sample_01.txt,subtask0_sample_02.txt,subtask0_sample_03.txt,subtask0_sample_04.txt,subtask1_01.txt,subtask1_02.txt,subtask1_03.txt,subtask1_04.txt,subtask1_05.txt,subtask1_06.txt,subtask1_07.txt,subtask1_08.txt,subtask1_09.txt,subtask1_10.txt,subtask1_11.txt,subtask1_12.txt,subtask1_13.txt,subtask1_14.txt,subtask1_15.txt,subtask1_16.txt,subtask1_17.txt,subtask1_corner.txt,subtask1_killer1.txt,subtask1_killer2.txt,subtask1_killer3.txt,subtask1_killer4.txt,subtask1_killer5.txt,subtask2_01.txt,subtask2_02.txt,subtask2_03.txt,subtask2_04.txt,subtask2_05.txt,subtask2_06.txt,subtask2_07.txt,subtask2_08.txt,subtask2_09.txt,subtask2_10.txt,subtask2_11.txt,subtask2_12.txt,subtask2_13.txt,subtask2_14.txt,subtask2_15.txt,subtask2_16.txt,subtask2_17.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
subtask0_sample_01.txt WA
subtask0_sample_02.txt AC 1 ms 256 KB
subtask0_sample_03.txt AC 1 ms 256 KB
subtask0_sample_04.txt WA
subtask1_01.txt RE
subtask1_02.txt WA
subtask1_03.txt WA
subtask1_04.txt WA
subtask1_05.txt AC 1 ms 256 KB
subtask1_06.txt AC 2 ms 256 KB
subtask1_07.txt WA
subtask1_08.txt WA
subtask1_09.txt WA
subtask1_10.txt WA
subtask1_11.txt WA
subtask1_12.txt WA
subtask1_13.txt WA
subtask1_14.txt WA
subtask1_15.txt WA
subtask1_16.txt WA
subtask1_17.txt WA
subtask1_corner.txt AC 1 ms 256 KB
subtask1_killer1.txt WA
subtask1_killer2.txt WA
subtask1_killer3.txt WA
subtask1_killer4.txt WA
subtask1_killer5.txt WA
subtask2_01.txt RE
subtask2_02.txt WA
subtask2_03.txt WA
subtask2_04.txt WA
subtask2_05.txt AC 41 ms 1792 KB
subtask2_06.txt AC 42 ms 1792 KB
subtask2_07.txt WA
subtask2_08.txt WA
subtask2_09.txt WA
subtask2_10.txt WA
subtask2_11.txt WA
subtask2_12.txt WA
subtask2_13.txt WA
subtask2_14.txt WA
subtask2_15.txt WA
subtask2_16.txt WA
subtask2_17.txt WA