結果
| 問題 | No.3413 あわてんぼうのルクくん |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-20 05:38:16 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 490 bytes |
| 記録 | |
| コンパイル時間 | 2,549 ms |
| コンパイル使用メモリ | 194,600 KB |
| 実行使用メモリ | 7,852 KB |
| 最終ジャッジ日時 | 2025-12-20 05:38:25 |
| 合計ジャッジ時間 | 8,362 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
ll g(ll a,ll b){
if(b==0) return a;
else return g(b,a%b);
}
int main() {
cin.tie(nullptr); ios_base::sync_with_stdio(false);
ll i,j;
ll Q;
cin >> Q;
while(Q--){
ll X,N,d;
cin >> X >> N >> d;
if(g(X,d)!=1){
cout << "inf" << endl;
continue;
}
cout << (X-1)*(X+d)-X << endl;
}
return 0;
}