結果

問題 No.1665 quotient replace
ユーザー gmm_tea
提出日時 2021-09-03 22:36:49
言語 Ruby
(3.4.1)
結果
TLE  
実行時間 -
コード長 354 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 89,344 KB
最終ジャッジ日時 2024-12-15 15:21:14
合計ジャッジ時間 122,625 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 TLE * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require "prime"
gets
a=gets.split.map(&:to_i)
x=0
a.each do |aa|
  next if aa==1
  a2=(aa**0.5).ceil
  i=2
  b=0
  while aa>1||i==2
    if aa%i==0
      aa/=i
      b+=1
    else
      i+=1
    end
  end
  while aa>1||i<=a2
    if aa%i==0
      aa/=i
      b+=1
    else
      i+=2
    end
  end
  x^=b
end
if x==0
  puts "black"
else
  puts "white"
end
0