/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 796.0 KiB
#2 Accepted 9ms 1.277 MiB
#3 Accepted 8ms 1.289 MiB
#4 Accepted 8ms 1.184 MiB
#5 Accepted 8ms 1.266 MiB
#6 Accepted 8ms 1.164 MiB
#7 Accepted 8ms 1.258 MiB
#8 Accepted 8ms 1.277 MiB
#9 Accepted 14ms 1.688 MiB
#10 Accepted 8ms 1.281 MiB

Code

#include <bits/stdc++.h>
using namespace std;
#define SC               scanf
#define PF               printf
#define ull              unsigned long long
#define ld               long double
#define F                first
#define S                second
#define pb               push_back
#define sort_a(a)        sort(a.begin(),a.end());
#define sort_d(a)        sort(a.rbegin(),a.rend());
#define READ(f)          freopen(f, "r", stdin)
#define WRITE(f)         freopen(f, "w", stdout)
#define rev(s)           reverse(s.begin(),s.end())
#define P(ok)            cout << (ok ? "YES\n": "NO\n")
#define __Heart__              ios_base :: sync_with_stdio(false); cin.tie(NULL);
#define ll long long
typedef pair< ll , ll>                   PII;
vector < int > Ans ;
void preCal(){
    for(int i = 6 ; i <= 100000 ; i++){
        if(i % 6 == 0 || i % 10 == 0 || i % 15 == 0) Ans.pb(i) ;
    }
}
void solve()
{
    int n ; cin >> n ;
    if(n == 3) {
        cout << "6 10 15\n" ;
    }
    else{
        for(int i = 0 ; i < n ; i++) cout << Ans[i] << " " ; cout << "\n" ;
    }

}
int main()
{
     __Heart__
     preCal() ;
     //READ("in.txt") ;
     //WRITE("out.txt") ;
     int t ; cin >> t ; while(t--) solve() ;
}

Information

Submit By
Type
Submission
Problem
P1070 Strange Sequences
Language
C++20 (G++ 13.2.0)
Submit At
2024-07-09 14:22:17
Judged At
2024-07-09 14:22:17
Judged By
Score
100
Total Time
14ms
Peak Memory
1.688 MiB