結果
問題 | No.1409 Simple Math in yukicoder |
ユーザー |
![]() |
提出日時 | 2021-02-26 23:00:46 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 82 ms / 2,000 ms |
コード長 | 779 bytes |
コンパイル時間 | 4,126 ms |
コンパイル使用メモリ | 253,140 KB |
最終ジャッジ日時 | 2025-01-19 06:38:56 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 58 |
ソースコード
#include <stdio.h>#include <atcoder/all>#include <bits/stdc++.h>using namespace std;using namespace atcoder;using mint = modint1000000007;#define rep(i,n) for (int i = 0; i < (n); ++i)#define Inf 1000000001int main(){int T;cin>>T;rep(_,T){int v,x;cin>>v>>x;set<int> ans;for(int i=0;true;i++){ans.insert(pow_mod(i+1,v,v*x+1));if(ans.size()==x)break;}// sort(ans.begin(),ans.end());//ans.erase(unique(ans.begin(),ans.end()),ans.end());//if(ans[0]==0)ans.erase(ans.begin());//cout<<ans.size()<<endl;bool f = true;for(auto a:ans){if(f)f=false;else cout<<' ';cout<<a;}cout<<endl;/*rep(i,min(x,(int)ans.size())){if(i!=0)cout<<' ';cout<<ans[i];}cout<<endl;*/}return 0;}