結果

問題 No.2125 Inverse Sum
ユーザー _yurimoir_yurimoir
提出日時 2022-11-19 07:13:26
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 457 bytes
コンパイル時間 3,137 ms
コンパイル使用メモリ 251,272 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-20 13:57:26
合計ジャッジ時間 4,285 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
4,348 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,348 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,348 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 2 ms
4,348 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll p,q;
    cin>>p>>q;
    set<pair<ll,ll>> st;
    for(ll i=1;i<=sqrt(q);i++){
        if(q%i==0){
            if((i+q)%p==0
            && (q/i+q)%p==0){
                st.insert({(i+q)/p,(q/i+q)/p});
                st.insert({(q/i+q)/p,(i+q)/p});
            }
        }
    }
    cout<<(int)st.size()<<endl;
    for(auto[n,m]:st)cout<<n<<" "<<m<<endl;
    return 0;
}
0