結果
問題 |
No.2015 Stair Counter
|
ユーザー |
![]() |
提出日時 | 2024-11-10 12:57:24 |
言語 | Swift (6.0.3) |
結果 |
RE
|
実行時間 | - |
コード長 | 528 bytes |
コンパイル時間 | 13,167 ms |
コンパイル使用メモリ | 132,188 KB |
実行使用メモリ | 20,164 KB |
最終ジャッジ日時 | 2024-11-10 12:57:43 |
合計ジャッジ時間 | 19,111 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 12 RE * 13 |
コンパイルメッセージ
Main.swift:2:5: warning: immutable value 'i' was never used; consider replacing with '_' or removing it for i in 1...t{ ^ _
ソースコード
let t = Int(readLine()!)! for i in 1...t{ let nm = readLine()!.split(separator: " ").map{Int($0)!} let (n,m) = (nm[0],nm[1]) var A = [0,m] + readLine()!.split(separator: " ").map{Int($0)!} var f = true for i in 2...n{ let a = A[i]-A[i-2] if a < 0{ f = false } A[i-1] -= a if A[i-1] < 0{ f = false } } if A[n+1] != A[n-1] + A[n]{ f = false } if f { print("Yes") }else{ print("No") } }