結果

問題 No.1409 Simple Math in yukicoder
ユーザー auauaauaua
提出日時 2021-02-27 18:12:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,151 bytes
コンパイル時間 2,109 ms
コンパイル使用メモリ 169,604 KB
実行使用メモリ 176,544 KB
最終ジャッジ日時 2024-04-10 15:46:39
合計ジャッジ時間 35,086 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,760 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 528 ms
6,944 KB
testcase_08 AC 1,827 ms
6,940 KB
testcase_09 AC 460 ms
6,944 KB
testcase_10 AC 1,445 ms
6,940 KB
testcase_11 AC 1,780 ms
6,944 KB
testcase_12 AC 1,361 ms
6,940 KB
testcase_13 AC 521 ms
6,940 KB
testcase_14 AC 416 ms
6,940 KB
testcase_15 AC 619 ms
6,944 KB
testcase_16 AC 684 ms
6,940 KB
testcase_17 TLE -
testcase_18 AC 1,175 ms
6,944 KB
testcase_19 AC 1,280 ms
6,944 KB
testcase_20 AC 1,013 ms
6,940 KB
testcase_21 AC 794 ms
6,940 KB
testcase_22 AC 1,519 ms
6,944 KB
testcase_23 AC 312 ms
6,940 KB
testcase_24 AC 240 ms
6,940 KB
testcase_25 AC 1,453 ms
6,944 KB
testcase_26 AC 1,591 ms
6,944 KB
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
#define double long double
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
//typedef long double ld;
typedef complex<double> Complex;
const ll INF=1e9+7;
const ll MOD=998244353;
const ll inf=INF*INF;
//const ll mod=INF;
const ll MAX=140010;


//二分累乗

ll rui(ll a,ll b,ll mod){
    ll res=1;
    ll x=a;
    while(b){
        if(b&1)res=res*x%mod;
        x=x*x%mod;
        b/=2;
    }
    return res;
}



signed main(){
    ll t;cin>>t;
    while(t--){
        ll v,x;
        cin>>v>>x;
        ll p=x*v+1;
        vector<ll>ans(0);
        REP(i,1,p+1){
            if(rui(i,x,p)==1){
                ans.pb(i);
            }
        }
        sort(all(ans));
        rep(i,x){
            cout<<ans[i]<<' ';
        }
        cout<<endl;
    }
}
0