結果
| 問題 |
No.607 開通777年記念
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-08 01:45:29 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 440 bytes |
| コンパイル時間 | 43 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 13,824 KB |
| 最終ジャッジ日時 | 2024-11-29 05:35:42 |
| 合計ジャッジ時間 | 2,447 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 2 |
コンパイルメッセージ
Syntax OK
ソースコード
n, m = gets.chomp.split.map(&:to_i)
a = [0] * n
m.times do
xs = gets.chomp.split.map(&:to_i)
n.times do |i|
a[i] += xs[i]
end
s = a[0]
i = 0
j = 1
ok = false
while i < j
while s < 777 and j < n
s += a[j]
j += 1
end
while s > 777
s -= a[i]
i += 1
end
if s == 777
ok = true
break
end
break if j >= n
end
if ok
puts :YES
exit
end
end
puts :NO