結果

問題 No.106 素数が嫌い!2
ユーザー YugimnYugimn
提出日時 2022-05-11 03:20:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 819 bytes
コンパイル時間 1,901 ms
コンパイル使用メモリ 190,340 KB
実行使用メモリ 19,576 KB
最終ジャッジ日時 2023-09-25 12:39:41
合計ジャッジ時間 3,630 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 47 ms
19,436 KB
testcase_02 AC 47 ms
19,292 KB
testcase_03 AC 46 ms
19,212 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 52 ms
19,336 KB
testcase_07 AC 53 ms
19,336 KB
testcase_08 WA -
testcase_09 AC 47 ms
19,200 KB
testcase_10 AC 52 ms
19,324 KB
testcase_11 AC 48 ms
19,132 KB
testcase_12 WA -
testcase_13 AC 47 ms
19,232 KB
testcase_14 AC 47 ms
19,184 KB
testcase_15 AC 46 ms
19,260 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:9:12: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
    9 | void print(auto a){
      |            ^~~~
main.cpp:13:13: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
   13 | void prints(auto a){
      |             ^~~~
main.cpp:21:13: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
   21 | void printl(auto a){
      |             ^~~~

ソースコード

diff #

//Normal

#define _GLIBCXX_DEBUG
#define ll long long
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

void print(auto a){
  cout << a;
}

void prints(auto a){
  cout << a << " ";
}

void prints(){
  cout << " ";
}

void printl(auto a){
  cout << a << endl;
}

void printl(){
  cout << endl;
}

void fix(int n){
  cout << fixed << setprecision(n);
}

int siz(string s){
  return (int)s.size();
}

int main(){
  int N, K; cin >> N >> K;
  vector<int> X(4e6, 0);
  vector<bool> Era(4e6, true);
  Era[0] = Era[1] = false;

  for(int i = 2; i*i <= 2e6; i++){
    if(!Era[i]) continue;
    X[i]++;

    for(int j = i*2; j <= 2e6; j += i){
      Era[j] = false;
      X[j]++;
    }
  }

  int ans = 0;
  for(int i = 2; i <= N; i++){
    if(K <= X[i]) ans++;
  }

  printl(ans);

  return 0;
}
0