結果

問題 No.3159 Just Answer 10 Integers!
ユーザー umezo
提出日時 2025-05-24 06:58:14
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 521 bytes
コンパイル時間 3,611 ms
コンパイル使用メモリ 275,696 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-24 06:58:18
合計ジャッジ時間 3,616 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
template <class T> using V=vector<T>;
template <class T> using VV=V<V<T>>;

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  V<int> P={2,3,5,7,11,13,17,19,23};
  int n;
  cin>>n;
  V<int> S(n);
  S[0]=1;
  rep(i,n-1) S[0]*=P[i];
  for(int i=1;i<n;i++) S[i]=S[0]/P[i-1];
  rep(i,n){
    if(i) cout<<" ";
    cout<<S[i];
  }
  cout<<endl;

  return 0;
}
0