/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Wrong Answer 8ms 976.0 KiB
#3 Wrong Answer 8ms 968.0 KiB

Code

#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
  int t;
  cin >> t;
  while (t--){
    int n, i, j;
    cin >> n;
    //vector<int> a(n + 2), vis(n + 2);
    if (n == 3){
      cout << "6 10 15\n";
      continue;
    }
    cout << "6 10 ";
    for (i = 12, j = 3; j < n; i += 2){
      //int x = __gcd(i, 6);
      //int y = __gcd(i, 10);
      //if (x > 1 && y > 1){
        cout << i << ' ';
        j++;
     // }
    }
    for ( ; ; i++){
      int x = __gcd(6, i);
      int y = __gcd(10, i);
      int z = __gcd(6, __gcd(10, i));
      if (x > 1 && y > 1 && z == 1){
        cout << i << endl;
        break;
      }
    }
    cout << endl; //mx<<" "<<j<<endl;
  }
}

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 18:07:42
Judged At
2024-11-11 03:22:25
Judged By
Score
10
Total Time
8ms
Peak Memory
976.0 KiB