/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 332.0 KiB
#2 Wrong Answer 16ms 1.062 MiB
#3 Wrong Answer 16ms 1.066 MiB
#4 Wrong Answer 15ms 976.0 KiB
#5 Wrong Answer 15ms 1.0 MiB
#6 Wrong Answer 16ms 1020.0 KiB
#7 Wrong Answer 16ms 1.078 MiB
#8 Wrong Answer 15ms 988.0 KiB
#9 Wrong Answer 30ms 1.512 MiB
#10 Wrong Answer 15ms 1.047 MiB

Code

#include <bits/stdc++.h>
#include <math.h>
 
using namespace std;
 
// Macros
#define REP(i, j, n) for(int i = j; i < n; i++)
#define trav(i, a) for(auto i: a)
#define all(x) x.begin(), x.end()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define F first
#define S second
#define GCD __gcd
 
// Type Names
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> pii;

// custom hash
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

ll square(ll x){
	return x * x;
}

bool is_right_triangle(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3){
	ll dist1 = square(x1 - x2) + square(y1 - y2);
	ll dist2 = square(x1 - x3) + square(y1 - y3);
	ll dist3 = square(x2 - x3) + square(y2 - y3);
	vll dist{dist1, dist2, dist3};
	sort(all(dist));
	if (dist[0] + dist[1] == dist[2]) return true;
	return false;
}

void solve(){
	int n;
	cin >> n;
	n -= 3;
	cout << 6 << " " << 10 << " " << 15 << " ";
	int track = 15;
	int i = 0;
	while (i < n){
		track++;
		if (track % 3 == 0 && track % 2 == 0){
			cout << track << " ";
			i++;
		}
		else if (track % 5 == 0){
			cout << track << " ";
			i++;
		}
	}
}

 
int main()
{
    cin.tie(NULL);
    cout.tie(NULL);
    ios_base::sync_with_stdio(false);
    int t;
    cin >> t;
    for(int i = 0; i < t; i++)
    solve();
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1070 Strange Sequences
Contest
Brain Booster #4
Language
C++11 (G++ 13.2.0)
Submit At
2024-07-14 17:18:12
Judged At
2024-10-03 13:36:16
Judged By
Score
0
Total Time
30ms
Peak Memory
1.512 MiB