結果

問題 No.983 Convolution
ユーザー wonda_t_coffeewonda_t_coffee
提出日時 2020-02-11 13:45:41
言語 Ruby
(3.2.1 )
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 117 bytes
コンパイル時間 169 ms
実行使用メモリ 28,568 KB
最終ジャッジ日時 2022-11-24 17:25:53
合計ジャッジ時間 5,452 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
13,900 KB
testcase_01 AC 60 ms
13,728 KB
testcase_02 AC 61 ms
13,944 KB
testcase_03 AC 110 ms
23,704 KB
testcase_04 AC 106 ms
22,548 KB
testcase_05 AC 101 ms
21,012 KB
testcase_06 AC 117 ms
25,096 KB
testcase_07 AC 114 ms
24,196 KB
testcase_08 AC 73 ms
15,696 KB
testcase_09 AC 77 ms
17,496 KB
testcase_10 AC 68 ms
15,000 KB
testcase_11 AC 73 ms
16,168 KB
testcase_12 AC 125 ms
26,464 KB
testcase_13 AC 88 ms
17,992 KB
testcase_14 AC 91 ms
18,192 KB
testcase_15 AC 112 ms
23,308 KB
testcase_16 AC 101 ms
20,516 KB
testcase_17 AC 121 ms
24,684 KB
testcase_18 AC 72 ms
15,568 KB
testcase_19 AC 106 ms
20,644 KB
testcase_20 AC 133 ms
26,836 KB
testcase_21 AC 138 ms
24,264 KB
testcase_22 AC 76 ms
15,872 KB
testcase_23 AC 100 ms
21,836 KB
testcase_24 AC 73 ms
15,616 KB
testcase_25 AC 73 ms
15,180 KB
testcase_26 AC 85 ms
18,904 KB
testcase_27 AC 80 ms
17,692 KB
testcase_28 AC 106 ms
21,824 KB
testcase_29 AC 139 ms
28,568 KB
testcase_30 AC 107 ms
21,744 KB
testcase_31 AC 86 ms
18,284 KB
testcase_32 AC 113 ms
22,396 KB
testcase_33 AC 64 ms
13,832 KB
testcase_34 AC 63 ms
14,004 KB
testcase_35 AC 63 ms
13,796 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:5: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i) - [-1]

if a.empty?
  puts -1
else
  puts a.inject(&:gcd)**2
end
0