結果

問題 No.3186 Big Order
ユーザー kotatsugame
提出日時 2025-06-23 08:55:31
言語 Ruby
(3.4.1)
結果
AC  
実行時間 1,079 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 8,192 KB
実行使用メモリ 16,652 KB
最終ジャッジ日時 2025-06-23 08:56:00
合計ジャッジ時間 27,197 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets.to_i.times{
  a,b,c=gets.split.map &:to_i
  t=[]
  x=1
  300.times{
    x*=a
    t<<0
    while x%c==0
      x/=c
      t[-1]+=1
    end
  }
  l=150
  l-=1 while t[...l]!=t[l...l+l]
  puts (b/l*t[...l].sum+t[...b%l].sum)%998244353
}
0