/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 332.0 KiB
#2 Wrong Answer 146ms 1.227 MiB

Code

#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define nl "\n"
#define all(x) (x).begin(), (x).end()
#define Yes cout<<"Yes"<<"\n";
#define No  cout<<"No"<<"\n"; 
vector<int> generatePrimes(int N) {
    vector<int> primes;
    int num = 2;
    while (primes.size() < N) {
        bool isPrime = true;
        for (int i = 2; i * i <= num; ++i) {
            if (num % i == 0) {
                isPrime = false;
                break;
            }
        }
        if (isPrime) {
            primes.push_back(num);
        }
        ++num;
    }
    return primes;
}
void run(int t){
    int  n,k,m;
    cin >> n;
    vector<int> primes = generatePrimes(n);
    for (int i = 0; i < n; ++i) {
        cout << primes[i] << " ";
    }
        cout << nl;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    cin >> t;
    int c  = 1;
    while(t--){
        //cout << "Case " << c++ << ": ";
        run(t);
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1070 Strange Sequences
Contest
Brain Booster #4
Language
C++17 (G++ 13.2.0)
Submit At
2024-07-14 16:12:51
Judged At
2024-11-11 03:24:32
Judged By
Score
0
Total Time
146ms
Peak Memory
1.227 MiB