結果

問題 No.689 E869120 and Constructing Array 3
ユーザー ミドリムシミドリムシ
提出日時 2018-05-18 22:49:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,249 bytes
コンパイル時間 754 ms
コンパイル使用メモリ 74,400 KB
実行使用メモリ 6,976 KB
最終ジャッジ日時 2023-09-10 23:06:57
合計ジャッジ時間 3,839 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,768 KB
testcase_01 AC 12 ms
6,816 KB
testcase_02 AC 11 ms
6,688 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 12 ms
6,808 KB
testcase_14 AC 11 ms
6,680 KB
testcase_15 AC 12 ms
6,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
long gcd(long a, long b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl(long(n))

#define sieve int(1e6 + 10)

int main(){
    vector<int> prime_sieve(sieve, -1);
    prime_sieve[0] = prime_sieve[1] = 0;
    for(int i = 2; i < sieve; i++){
        if(prime_sieve[i] == -1){
            prime_sieve[i] = 1;
            for(int j = i * 2; j < sieve; j += i){
                prime_sieve[j] = 0;
            }
        }
    }
    int K;
    cin >> K;
    if(K < 250){
        cout << K + 1 << endl;
        vector<int> ans(K + 1, 2);
        ans[0] = 3;
        array_output(all(ans));
    }
}

0