結果

問題 No.1409 Simple Math in yukicoder
ユーザー auauaauaua
提出日時 2021-02-27 17:51:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,534 bytes
コンパイル時間 1,834 ms
コンパイル使用メモリ 171,132 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-04-10 15:45:13
合計ジャッジ時間 47,595 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,756 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 2 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 396 ms
6,944 KB
testcase_08 AC 1,304 ms
6,940 KB
testcase_09 AC 264 ms
6,948 KB
testcase_10 AC 1,048 ms
6,944 KB
testcase_11 AC 1,319 ms
6,944 KB
testcase_12 AC 1,021 ms
6,944 KB
testcase_13 AC 391 ms
6,944 KB
testcase_14 AC 366 ms
6,944 KB
testcase_15 AC 492 ms
6,944 KB
testcase_16 AC 450 ms
6,944 KB
testcase_17 AC 1,681 ms
6,940 KB
testcase_18 AC 819 ms
6,940 KB
testcase_19 AC 940 ms
6,940 KB
testcase_20 AC 689 ms
6,944 KB
testcase_21 AC 645 ms
6,940 KB
testcase_22 AC 1,070 ms
6,944 KB
testcase_23 AC 209 ms
6,944 KB
testcase_24 AC 205 ms
6,948 KB
testcase_25 AC 894 ms
6,944 KB
testcase_26 AC 1,104 ms
6,940 KB
testcase_27 TLE -
testcase_28 AC 1,818 ms
6,944 KB
testcase_29 AC 1,934 ms
6,940 KB
testcase_30 AC 1,937 ms
6,944 KB
testcase_31 AC 1,917 ms
6,944 KB
testcase_32 AC 1,878 ms
6,944 KB
testcase_33 AC 1,921 ms
6,944 KB
testcase_34 AC 1,762 ms
6,944 KB
testcase_35 AC 1,761 ms
6,940 KB
testcase_36 AC 1,882 ms
6,940 KB
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;




signed main(){
    ll t;cin>>t;
    while(t--){
        ll v,x;
        cin>>v>>x;
        if(x==1){
            cout<<1<<endl;
            continue;
        }
        ll p=x*v+1;
        for(int i=1;i<=p-1;i++){
            vector<bool>used(p);
            ll now=1;
            bool f=0;
            rep(j,x){
                if(used[now])f=1;
                used[now]=1;
                now=i*now%p;
            }
            if(f==0){
                now=1;
                vector<ll>ans(0);
                ll sum=0;
                rep(j,x){
                    sum+=now;
                    ans.pb(now);
                    now=now*i%p;
                }
                if(sum%p!=0)continue;
                sort(all(ans));
                rep(j,x){
                    cout<<ans[j]<<' ';
                }
                cout<<endl;
                break;
            }
        }
    }
}
0