結果

問題 No.3159 Just Answer 10 Integers!
ユーザー hirakuuuu
提出日時 2025-05-23 19:41:53
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 836 bytes
コンパイル時間 3,218 ms
コンパイル使用メモリ 275,956 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-23 19:41:57
合計ジャッジ時間 3,500 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:28:22: warning: narrowing conversion of ‘tmp’ from ‘long long int’ to ‘int’ [-Wnarrowing]
   28 |     vector<int> s = {tmp};
      |                      ^~~
main.cpp:28:22: warning: narrowing conversion of ‘tmp’ from ‘long long int’ to ‘int’ [-Wnarrowing]

ソースコード

diff #

#include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rrep(i, a, n) for(int i = a; i >= n; i--)
#define inr(l, x, r) (l <= x && x < r)
#define ll long long
#define ld long double

// using mint = modint1000000007;
// using mint = modint998244353;
constexpr int IINF = 1001001001;
constexpr ll INF = 1e18;

template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}


int main(){
    vector<int> p = {2, 3, 5, 7, 11, 13, 17, 19, 23};
    ll tmp = 1;
    rep(i, 0, 9){
        tmp *= p[i];
    }

    int n; cin >> n;
    vector<int> s = {tmp};
    rep(i, 0, n-1) s.push_back(tmp/p[i]);
    rep(i, 0, n){
        cout << s[i] << ' ';
    }
    cout << endl;




    return 0;
}
0