結果
| 問題 | No.8015 アンチローリングハッシュ |
| ユーザー |
a01sa01to
|
| 提出日時 | 2025-07-24 00:44:53 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 764 bytes |
| 記録 | |
| コンパイル時間 | 2,067 ms |
| コンパイル使用メモリ | 339,528 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-13 11:19:12 |
| 合計ジャッジ時間 | 5,329 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
a01sa01to