結果
問題 |
No.8015 アンチローリングハッシュ
|
ユーザー |
![]() |
提出日時 | 2025-07-24 00:44:53 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 764 bytes |
コンパイル時間 | 3,130 ms |
コンパイル使用メモリ | 283,492 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-07-24 00:45:01 |
合計ジャッジ時間 | 6,684 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 3 WA * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); ll x, y; cin >> x >> y; map<ull, string> mp; for (int a = 'a'; a <= 'z'; ++a) { for (int b = 'a'; b <= 'z'; ++b) { for (int c = 'a'; c <= 'z'; ++c) { for (int d = 'a'; d <= 'z'; ++d) { string s = { char(a), char(b), char(c), char(d) }; ull hash = (a + x * b + x * x * c + x * x * x * d) % y; if (mp.contains(hash)) { cout << s << '\n' << mp[hash] << '\n'; return 0; } mp[hash] = s; } } } } assert(false); return 0; }