fork download
  1. /*----<Bồ tác phù hộ code không bị bug>--------
  2.   _oo0oo_
  3.   o8888888o
  4.   88" . "88
  5.   (| -_- |)
  6.   0\ = /0
  7.   ___/`---'\___
  8.   .' \| |// '.
  9.   / \||| : |||// \
  10.   / _||||| -:- |||||- \
  11.   | | \ - /// | |
  12.   | \_| ''\---/'' |_/ |
  13.   \ .-\__ '-' ___/-. /
  14.   ___'. .' /--.--\ `. .'___
  15.   ."" '< `.___\_<|>_/___.' >' "".
  16.  | | : `- \`.;`\ _ /`;.`/ - ` : | |
  17.  \ \ `_. \_ __\ /__ _/ .-` / /
  18. =====`-.____`.___ \_____/___.-`___.-'=====
  19.   `=---='
  20. ------------------<>-------------------------*/
  21.  
  22. #include <bits/stdc++.h>
  23.  
  24. #define __Nakano signed
  25. #define Miku__ main()
  26. #define int long long
  27. #define fi first
  28. #define se second
  29. #define all(x) x.begin(), x.end()
  30. #define rall(x) x.rbegin(), x.rend()
  31. #define fr(x, l, r) for (int x = l; x < r; x++)
  32. #define frr(x, l, r) for (int x = l; x <= r; x++)
  33. #define fd(x, l, r) for (int x = l; x >= r; x--)
  34. #define cs const
  35. #define TIME (1.0*clock() / CLOCKS_PER_SEC)
  36. #define RUNTIME cerr << "\n" << "Runtime: " << TIME << "s\n";
  37. #define Fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  38. #define Nakanomiku ios_base::sync_with_stdio(0);
  39. #define TiemNetBaTuyen cin.tie(0);
  40. #define THCSPHAMHUYTHONG cout.tie(0);
  41.  
  42. typedef double db;
  43. typedef std::string str;
  44. typedef std::vector<int> vi;
  45. typedef std::greater<int> gi;
  46. typedef std::map<int, int> mii;
  47. typedef std::pair<int, int> ii;
  48.  
  49. inline int gcd(int a,int b){int s;while(b){s=a%b;a=b;b=s;}return a;}
  50. inline int lcm(int a, int b){return a/gcd(a,b)*b;}
  51.  
  52. cs int N = 1e6 + 5;
  53. cs int oo = 1e18;
  54.  
  55. using namespace std;
  56. vector<bool> p(N,true);
  57. void sang(){
  58. p[0] = p[1] = false;
  59. for (int i = 4; i <= N; i += 2) p[i] = false;
  60. for (int i = 3; i * i <= N; i += 2){
  61. if (p[i]){
  62. for (int j = i * i; j <= N; j += i * 2) p[j] = false;
  63. }
  64. }
  65. }
  66. __Nakano Miku__ {
  67. Nakanomiku TiemNetBaTuyen THCSPHAMHUYTHONG
  68. int n; cin >> n;
  69. sang();
  70. RUNTIME;
  71. return 0;
  72. }
Success #stdin #stdout #stderr 0.01s 5276KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Runtime: 0.007641s