Submission #2460589
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define INF_LL (int64)1e18 #define INF (int32)1e9 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(x) x.begin(),x.end() #define fs first #define sc second using int32 = int_fast32_t; using uint32 = uint_fast32_t; using int64 = int_fast64_t; using uint64 = uint_fast64_t; using PII = pair<int32, int32>; using PLL = pair<int64, int64>; const double eps = 1e-10; template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;} template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;} using PDI = pair<double, int32>; const int64 mod = 1e9+7; int32 dx[4] = {-1, 1, 0, 0}; int32 dy[4] = {0, 0, -1, 1}; int main(void){ int32 N; cin >> N; int32 res = 0; FOR(i, 2, 55556){ int32 cnt = 0; FOR(j, 2, i){ if(i%j == 0) cnt++; } if(cnt == 0 && i%5 == 1){ cout << i << endl; res++; if(res == N) break; } } }
Submission Info
Submission Time | |
---|---|
Task | D - Five, Five Everywhere |
User | maze1230 |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 1015 Byte |
Status | AC |
Exec Time | 4 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 | 4 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 |