답안 #923519

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
923519 2024-02-07T11:13:12 Z Ianis Binary Subsequences (info1cup17_binary) C++17
12.9 / 100
15 ms 4188 KB
#ifdef LOCAL
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <random>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#else
#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
#define cerr if (false) cerr 
#define endl '\n'
#endif

#define fi first
#define se second

#define sz(a) ((int)(a).size())
#define all(a) (a).begin(), (a).end()

#define lsb(x) (x & (-x))

#define bit(mask, i) (((mask) >> (i)) & 1)
#define popcount(x) __builtin_popcount(x)

#define YES cout << "YES" << endl
#define NO cout << "NO" << endl

using namespace std;

template <typename T>
bool ckmax(T &a, T b) { return a < b ? a = b, true : false; }
template <typename T>
bool ckmin(T &a, T b) { return a > b ? a = b, true : false; }

using ll = long long;
using pii = pair<int, int>;

const int NMAX = 1e6+10;
const int MOD  = 1e9+7;

int n;
int phi[NMAX];

void read() {
   cin >> n;
}

void precalc() {
   for (int i = 2; i < NMAX; i++) {
      phi[i] += i - 1;
      for (int j = 2 * i; j < NMAX; j += i)
         phi[j] -= phi[i];
   }
}

void solve() {
   cout << phi[n + 2] << endl << -1 << endl;
}

signed main() {
#ifdef LOCAL
   freopen("input.txt", "r", stdin);
#endif
   ios_base::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
   
   int t = 1;
   cin >> t;

   precalc();
   while (t--) {
      read();
      solve();
   }

   return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 14 ms 4184 KB Output is partially correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 4184 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 14 ms 4188 KB Output isn't correct
2 Halted 0 ms 0 KB -