結果
| 問題 | No.3682 きあいのハチマキ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-05 14:21:49 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 18 ms / 2,000 ms |
| + 215µs | |
| コード長 | 855 bytes |
| 記録 | |
| コンパイル時間 | 4,119 ms |
| コンパイル使用メモリ | 378,740 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-05 14:22:14 |
| 合計ジャッジ時間 | 5,680 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
using mint = atcoder::modint998244353;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int T;
cin >> T;
while(T--){
array<ll, 3> A, B;
cin >> A[0] >> A[1] >> A[2];
cin >> B[0] >> B[1] >> B[2];
ll MA = (B[0] + A[1] - 1) / A[1];
ll MB = (A[0] + B[1] - 1) / B[1];
mint coef = 1, ans = 0, div10 = mint(10).inv(), div100 = div10 * div10;
coef = div10.pow(abs(MA - MB));
if(MA < MB) ans += 1 - coef;
if(A[2] == B[2]){
ans += coef * mint(2).inv();
}else if(A[2] > B[2]){
ans += coef * 9 / (1 - div100) * div10;
}else{
ans += coef * 9 / (1 - div100) * div100;
}
cout << ans.val() << '\n';
}
}