結果
| 問題 | No.2015 Stair Counter |
| コンテスト | |
| ユーザー |
rururun
|
| 提出日時 | 2024-11-10 12:57:24 |
| 言語 | Swift (6.2.4) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 528 bytes |
| 記録 | |
| コンパイル時間 | 2,386 ms |
| コンパイル使用メモリ | 149,852 KB |
| 実行使用メモリ | 20,724 KB |
| 最終ジャッジ日時 | 2026-05-09 12:50:09 |
| 合計ジャッジ時間 | 8,659 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 [#no-usage]
1 | let t = Int(readLine()!)!
2 | for i in 1...t{
| `- warning: immutable value 'i' was never used; consider replacing with '_' or removing it [#no-usage]
3 | let nm = readLine()!.split(separator: " ").map{Int($0)!}
4 | let (n,m) = (nm[0],nm[1])
ソースコード
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")
}
}
rururun