結果
| 問題 | No.2306 [Cherry 5th Tune C] ウソツキタマシイ |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-07-03 10:20:57 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 192 bytes |
| 記録 | |
| コンパイル時間 | 175 ms |
| コンパイル使用メモリ | 7,680 KB |
| 実行使用メモリ | 88,508 KB |
| 最終ジャッジ日時 | 2024-07-17 07:37:30 |
| 合計ジャッジ時間 | 6,847 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 TLE * 1 -- * 22 |
コンパイルメッセージ
Main.rb:7: warning: assigned but unused variable - n Main.rb:7: warning: assigned but unused variable - m Syntax OK
ソースコード
def f()
return gets.split(" ").map{|e| e.to_i}
end
def g(xs)
return xs.map{|e| e**2}.sum
end
n,m=f()
xs=f()
q=gets.to_i
q.times{
c,k,d=f()
xs[c-1],xs[d-1]=xs[c-1]-k,xs[d-1]+k
puts g(xs)
}
horiesiniti