結果

問題 No.607 開通777年記念
ユーザー syunsukesyunsuke
提出日時 2018-07-29 18:19:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,162 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 65,288 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-25 11:28:19
合計ジャッジ時間 4,917 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
7,524 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 192 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 7 ms
4,380 KB
testcase_11 TLE -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
int main(void){
    // Your code here!
    string ANS="NO";
    int N,M,NUM=0,num=0,ans=0,n;
    scanf("%d %d",&N,&M);
    int L[N];
    for (int i=0;i<N;i++){
        L[i]=0;
    }
    
    for (int l=0;l<=M;l++){
        for (int i=0;i<N;i++){
            scanf("%d",&n);
            L[i]+=n;
            //cout<<L[4]<<endl;
            ans=0;
            num=0;
            NUM=0;
            for (int j=0;j<1000000000;j++){
                if (ans==777){
                    ANS="YES";
                    break;
                }
                else if (ans>777){
                    ans=ans-L[num];
                    num+=1;
                    //cout<<j<<endl;
                }
                else if (ans<777){
                    if (NUM>N){
                        break;
                    }
                    else{
                    ans=ans+L[NUM];
                    //cout<<L[NUM]<<endl;
                    NUM+=1;
                    
                    }
                }
            //cout<<ans<<endl;   
            }
        }
    }
    cout<<ANS<<endl;
    return 0;
}
0