/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 9ms 1.527 MiB
#2 Wrong Answer 22ms 1.941 MiB
#3 Wrong Answer 23ms 1.887 MiB

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ps(b) cout << (b ? "YES" : "NO") << '\n'
#define pc cout << "Case " << tc << ": "
#ifdef LOCAL
#include "def.h"
#else
#define ck(...) 
#endif
const ll M = 1e9 + 7, N = 2e4 + 5;
set<ll> v;
void pre(){
    ll j;
    for (j = 2; j < N; j++) {
        if((j&1 and (j*3)%5==0) or ~j&1) v.insert(j * 3);
    }
    for (j = 2; j < N; j++){
        if((j&1 and (j*5)%3 == 0) or ~j&1) v.insert(j * 5);
    }
}

void test(int tc) {
    ll a = 0, b = 0, c = 0, d = 0, i = 0, j = 0, k = 0, m = 0, n = 0, q = 0;
    cin >> n;
    // vector<ll> v(n); for (i = 0; i < n; ++i) { cin >> v[i]; }
    if(n==3) cout << 6 << ' ' << 10 << ' ' << 15;
    else {
        for (auto e:v){
            cout << e << ' ';
            if(--n == 0)
                break;
        }
    }
    cout << '\n';
}

signed main() {
    cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit|cin.badbit);
    int tc = 0, t = 1;
    pre();
    cin >> t;
    while (tc < t) test(++tc);
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1070 Strange Sequences
Contest
Brain Booster #4
Language
C++20 (G++ 13.2.0)
Submit At
2024-07-14 16:11:23
Judged At
2024-11-11 03:24:35
Judged By
Score
10
Total Time
23ms
Peak Memory
1.941 MiB