結果
問題 |
No.607 開通777年記念
|
ユーザー |
|
提出日時 | 2018-06-14 15:53:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 208 ms / 2,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 515 ms |
コンパイル使用メモリ | 65,080 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 14:23:28 |
合計ジャッジ時間 | 2,036 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int n,m,cnt[1000]; main() { cin>>n>>m; for(int q=0;q<m;q++) { for(int i=0;i<n;i++) { int a;cin>>a;cnt[i]+=a; } int sum=0,f=0; for(int i=0;i<n;i++) { sum+=cnt[i]; while(sum>777)sum-=cnt[f++]; if(sum==777) { cout<<"YES"<<endl; return 0; } } } cout<<"NO"<<endl; }