結果

問題 No.983 Convolution
ユーザー wonda_t_coffeewonda_t_coffee
提出日時 2020-02-11 13:45:41
言語 Ruby
(3.3.0)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 117 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 30,700 KB
最終ジャッジ日時 2024-04-08 14:46:13
合計ジャッジ時間 5,893 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
16,256 KB
testcase_01 AC 85 ms
16,256 KB
testcase_02 AC 84 ms
16,256 KB
testcase_03 AC 151 ms
25,856 KB
testcase_04 AC 140 ms
24,704 KB
testcase_05 AC 124 ms
22,656 KB
testcase_06 AC 155 ms
27,136 KB
testcase_07 AC 150 ms
26,496 KB
testcase_08 AC 100 ms
17,920 KB
testcase_09 AC 107 ms
19,584 KB
testcase_10 AC 92 ms
17,152 KB
testcase_11 AC 102 ms
18,432 KB
testcase_12 AC 160 ms
28,288 KB
testcase_13 AC 115 ms
19,840 KB
testcase_14 AC 120 ms
20,480 KB
testcase_15 AC 151 ms
25,344 KB
testcase_16 AC 130 ms
22,656 KB
testcase_17 AC 160 ms
26,880 KB
testcase_18 AC 99 ms
17,792 KB
testcase_19 AC 130 ms
22,528 KB
testcase_20 AC 172 ms
28,672 KB
testcase_21 AC 169 ms
26,496 KB
testcase_22 AC 105 ms
18,304 KB
testcase_23 AC 137 ms
24,064 KB
testcase_24 AC 97 ms
17,920 KB
testcase_25 AC 92 ms
17,408 KB
testcase_26 AC 112 ms
20,992 KB
testcase_27 AC 114 ms
19,840 KB
testcase_28 AC 136 ms
23,424 KB
testcase_29 AC 178 ms
30,700 KB
testcase_30 AC 129 ms
23,424 KB
testcase_31 AC 111 ms
20,224 KB
testcase_32 AC 144 ms
24,704 KB
testcase_33 AC 86 ms
16,256 KB
testcase_34 AC 88 ms
16,256 KB
testcase_35 AC 85 ms
16,256 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