結果
| 問題 |
No.607 開通777年記念
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-18 08:40:56 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 753 bytes |
| コンパイル時間 | 2,220 ms |
| コンパイル使用メモリ | 61,348 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-01 10:14:45 |
| 合計ジャッジ時間 | 2,976 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 4 WA * 6 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import sequtils
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
var minus = false
while true:
var k = getchar_unlocked()
if k == '-' : minus = true
elif k < '0' or k > '9': break
else: result = 10 * result + k.ord - '0'.ord
if minus: result *= -1
template times*(n:int,body) = (for _ in 0..<n: body)
let n = scan()
let m = scan()
var A = newSeq[int](n)
m.times:
for i in 0..<n: A[i] += scan()
var x = 0
var y = 1
var sum = A[x]
while true:
if sum == 777 : quit "YES",0
if y < A.len and sum + A[y] <= 777:
sum += A[y]
y += 1
continue
if x == y :
x += 1
y += 1
if x >= A.len: break
sum -= A[x]
x += 1
echo "NO"