結果

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

ソースコード

diff #

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

const int mod = 998244353;

ll pw(ll x,ll y){ll a=1;while(y){if(y%2)a=a*x%mod;x=x*x%mod;y/=2;}return a;}
ll inv(ll x){return pw(x,mod-2);}

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