結果

問題 No.657 テトラナッチ数列 Easy
ユーザー ミドリムシミドリムシ
提出日時 2017-10-26 22:09:20
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 620 bytes
コンパイル時間 746 ms
コンパイル使用メモリ 74,448 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-05-01 15:18:40
合計ジャッジ時間 5,084 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    int N, K, X;
    cin >> N >> K >> X;
    cout << N << endl << K << endl;
    vector<int> nums;
    random_device rd;
    for(int i = 0; i < N; i++){
        int num;
        bool if_ok = false;
        while(!if_ok){
            num = rd() % X;
            if_ok = true;
            for(int i = 0; i < nums.size(); i++){
                if(num == nums[i]){
                    if_ok = false;
                    break;
                }
            }
        }
        nums.push_back(num);
        cout << num << endl;
    }
}
0