/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 576.0 KiB
#2 Wrong Answer 2ms 576.0 KiB

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
P1054 Yet another challenge for Roy!
Language
C++20 (G++ 13.2.0)
Submit At
2024-07-09 14:00:41
Judged At
2024-11-11 03:28:40
Judged By
Score
0
Total Time
2ms
Peak Memory
576.0 KiB