Submission #5938933
Source Code Expand
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define VV 55555 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int N; int listP[VV + 1][4]; int counter[4]; int main() { cin >> N; // cout << N << endl; vector< bool > flg(VV + 1); FOR(i, 2, VV + 1) { if (!flg[i]) { for (int j = 2 * i; j <= VV; j += i) { flg[j] = true; } } } FOR(i, 2, VV + 1) { if (!flg[i]) { int modulo = i % 5 - 1; if (modulo == -1) continue; else { listP[modulo][counter[modulo]] = i; counter[modulo]++; } // printf("%d\n", i); } } // REP(i, 4) { cout << counter[i] << endl; } REP(i, N) { printf("%d ", listP[0][i]); } }
Submission Info
Submission Time | |
---|---|
Task | D - Five, Five Everywhere |
User | cygnus |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 901 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | in01.txt, in02.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in01.txt | AC | 2 ms | 256 KB |
in02.txt | AC | 2 ms | 256 KB |
sample_01.txt | AC | 2 ms | 256 KB |
sample_02.txt | AC | 2 ms | 256 KB |
sample_03.txt | AC | 2 ms | 256 KB |