結果
問題 | No.40 多項式の割り算 |
ユーザー |
|
提出日時 | 2021-06-23 09:54:40 |
言語 | Swift (6.0.3) |
結果 |
RE
|
実行時間 | - |
コード長 | 352 bytes |
コンパイル時間 | 9,521 ms |
コンパイル使用メモリ | 139,004 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-06-24 06:12:16 |
合計ジャッジ時間 | 11,615 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 RE * 1 |
ソースコード
let n = Int(readLine()!)!var a = readLine()!.split(separator: " ").map{Int($0)!}+[0,0]for i in (3...n).sorted(by: >){a[i-2]+=a[i]}if a[2] != 0{print(2)print(a[..<3].map{String($0)}.joined(separator: " "))}else if a[1] != 0{print(1)print(a[..<2].map{String($0)}.joined(separator: " "))}else{print(0)print(a[0])}