結果

問題 No.3015 アンチローリングハッシュ
ユーザー maimai
提出日時 2019-02-19 23:33:18
言語 Ruby
(3.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 227 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-04-21 06:12:41
合計ジャッジ時間 9,878 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
17,664 KB
testcase_01 AC 81 ms
12,288 KB
testcase_02 AC 78 ms
12,160 KB
testcase_03 AC 74 ms
12,288 KB
testcase_04 AC 80 ms
12,160 KB
testcase_05 AC 77 ms
12,288 KB
testcase_06 AC 100 ms
12,544 KB
testcase_07 AC 81 ms
12,288 KB
testcase_08 AC 92 ms
12,416 KB
testcase_09 AC 184 ms
12,416 KB
testcase_10 AC 309 ms
12,672 KB
testcase_11 AC 155 ms
12,416 KB
testcase_12 AC 127 ms
12,416 KB
testcase_13 AC 623 ms
12,416 KB
testcase_14 AC 439 ms
12,416 KB
testcase_15 AC 99 ms
12,416 KB
testcase_16 AC 341 ms
12,672 KB
testcase_17 AC 364 ms
12,672 KB
testcase_18 TLE -
testcase_19 TLE -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

@a,@b = gets.split.map(&:to_i)

def h(s)
    s.bytes.reduce(0){|ha,c|(ha*@a+c)%@b}
end
def g
    9.times.map{rand(97..122)}.pack("c*")
end

loop do
    s,t = g,g
    if h(s) == h(t)
        puts [s,t]
        break
    end
end
0