結果

問題 No.3159 Just Answer 10 Integers!
ユーザー ゼリトキ
提出日時 2025-05-23 20:35:30
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,493 bytes
コンパイル時間 3,073 ms
コンパイル使用メモリ 275,584 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-05-23 20:35:40
合計ジャッジ時間 3,942 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:60:38: warning: integer overflow in expression of type ‘int’ results in ‘-2120241362’ [-Woverflow]
   60 |         ll all=2*3*5*7*11*13*17*19*23*29;
      |                ~~~~~~~~~~~~~~~~~~~~~~^~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ll long long
const long long mod=998244353;
const long long hmod=46216567629137;
int main(){
    cin.tie(0)->sync_with_stdio(0);
    cout.tie(0);
    ll N;
    cin>>N;
    if(N==2){
        cout<<"2 3\n";
        return 0;
    }
    if(N==3){
        cout<<"2 6 3\n";
        return 0;
    }
    if(N==4){
        cout<<"60 15 12 20\n";
        return 0;
    }
    if(N==5){
        ll all=2*3*5*7*11;
        ll dat[5]={2,3,5,7,11};
        rep(i,5) cout<<all/dat[i]<<" ";
        cout<<"\n";
        return 0;
    }
    if(N==6){
        ll all=2*3*5*7*11*13;
        ll dat[6]={2,3,5,7,11,13};
        rep(i,6) cout<<all/dat[i]<<" ";
        cout<<"\n";
        return 0;
    }
    if(N==7){
        ll all=2*3*5*7*11*13*17;
        ll dat[7]={2,3,5,7,11,13,17};
        rep(i,7) cout<<all/dat[i]<<" ";
        cout<<"\n";
        return 0;
    }
    if(N==8){
        ll all=3*5*7*8*11*13*17;
        ll dat[8]={3,5,7,8,11,13,17,19};
        rep(i,8) cout<<all/dat[i]<<" ";
        cout<<"\n";
        return 0;
    }
    if(N==9){
        ll all=2*5*7*9*11*13*17;
        ll dat[9]={2,5,7,9,11,13,17,19,23};
        rep(i,9) cout<<all/dat[i]<<" ";
        cout<<"\n";
        return 0;
    }
    if(N==10){
        ll all=2*3*5*7*11*13*17*19*23*29;
        ll dat[10]={2,3,5,7,11,13,17,19,23,29};
        rep(i,10) cout<<all/dat[i]<<" ";
        cout<<"\n";
        return 0;
    }
}
0