結果

問題 No.3168 [Cherry 7th Tune D] Manhole
ユーザー ymm-knight
提出日時 2025-06-16 22:29:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 389 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 2,880 ms
コンパイル使用メモリ 193,668 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-16 22:29:41
合計ジャッジ時間 12,197 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

const int mod = 998244353;
ll inv(ll x, ll md = mod) {
	return x? (1 - inv(md%x, x)*md)/x%md+md: md;
}

int main()
{
	cin.tie(0) -> sync_with_stdio(false);
	int t;
	cin >> t;
	while (t--) {
		ll a, b, c;
		cin >> a >> b >> c;
		cout << (a*a + b*b + c*c) % mod * inv(c*c % mod) % mod << '\n';
	}
}
0