結果
| 問題 | No.607 開通777年記念 | 
| コンテスト | |
| ユーザー |  ikd | 
| 提出日時 | 2017-12-08 15:39:41 | 
| 言語 | D (dmd 2.109.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 706 bytes | 
| コンパイル時間 | 870 ms | 
| コンパイル使用メモリ | 101,848 KB | 
| 実行使用メモリ | 17,860 KB | 
| 最終ジャッジ日時 | 2024-06-12 22:53:35 | 
| 合計ジャッジ時間 | 4,428 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 2 | 
| other | AC * 3 WA * 1 TLE * 1 -- * 5 | 
ソースコード
void main(){
  import std.stdio, std.string, std.conv, std.algorithm;
  int n, m; rd(n, m);
  auto d=new int[][](m, n);
  foreach(i; 0..m) d[i]=readln.split.to!(int[]);
  auto a=new int[](n);
  int tg=777;
  bool ok=false;
  foreach(i; 0..m){
    a[]+=d[i][];
    int s=0;
    foreach(l; 0..n)foreach(r; l..n){
      for(int k=l; k<=r; k++){
        if((s+=a[k])==tg){writeln("YES"); return;}
      }
    }
  }
  writeln("NO");
}
void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}
void wr(T...)(T x){
  import std.stdio;
  foreach(e; x) stderr.write(e, " ");
  stderr.writeln;
}
            
            
            
        