結果

問題 No.3022 一元一次式 mod 1000000000
ユーザー t98slider
提出日時 2025-02-14 21:46:44
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 413 bytes
コンパイル時間 3,933 ms
コンパイル使用メモリ 252,316 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-02-14 21:47:14
合計ジャッジ時間 5,118 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

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

void solve(){
    ll n, m;
    cin >> n >> m;
    auto pa = atcoder::crt({-m, 0}, {1'000'000'000, n});
    if(pa.second == 0){
        cout << "-1\n";
        return;
    }
    cout << pa.first / n << '\n';
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int T;
    cin >> T;
    while(T--) solve();
}
0