結果

問題 No.1936 Rational Approximation
コンテスト
ユーザー noya2
提出日時 2021-12-20 15:56:40
言語 C++17(gcc12)
(gcc 12.4.0 + boost 1.90.0)
コンパイル:
g++-12 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 428 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,856 ms
コンパイル使用メモリ 335,564 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-06-24 20:28:02
合計ジャッジ時間 6,692 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

/*
入力 validation。WA なら OK。
*/

#include "testlib.h"
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll maxint = 1'000'000'000LL;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main(){
	registerValidation();
    ll p = inf.readLong(2LL,maxint-1LL,"p");
    inf.readSpace();
    ll q = inf.readLong(p+1,maxint,"q");
    inf.readEoln();
    assert(gcd(p,q) == 1LL);
	inf.readEof();
	return 0;
}
0