結果

問題 No.3168 [Cherry 7th Tune D] Manhole
コンテスト
ユーザー ymm-knight
提出日時 2025-06-16 22:29:28
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 151 ms / 2,000 ms
+ 904µs
コード長 366 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,165 ms
コンパイル使用メモリ 211,688 KB
実行使用メモリ 9,396 KB
最終ジャッジ日時 2026-07-12 06:50:54
合計ジャッジ時間 10,362 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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