Submission #2462058
Source Code Expand
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define INF (1<<30) #define INFLL (1ll<<60) typedef pair<int, int> P; typedef pair<ll, P> E; #define MOD (1000000007ll) #define l_ength size #define PI 3.14159265358979 void mul_mod(ll& a, ll b){ a *= b; a %= MOD; } void add_mod(ll& a, ll b){ a += b; a %= MOD; } int main(void){ int i,j,n; bool isp[60000]; fill(isp,isp+60000,true); isp[1] = false; for(i=2; i<=235; ++i){ if(!isp[i]){ continue; } for(j=(i*2); j<=55555; j+=i){ isp[j] = false; } } cin >> n; i = 6; n -= 1; cout << "2"; while(n){ if(isp[i]){ cout << " " << i; --n; } i += 5; } cout << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Five, Five Everywhere |
User | ransewhale |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 744 Byte |
Status | AC |
Exec Time | 1 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 | 1 ms | 256 KB |
in02.txt | AC | 1 ms | 256 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |