Submission #2460570
Source Code Expand
#include <bits/stdc++.h> using namespace std; vector<int> primes; vector<bool> isPrime; int main() { isPrime.assign(555556, true); for (int i = 2; i <= 55555; i++) { if (isPrime[i]) { if (i % 5 == 1) primes.push_back(i); for (int j = 2 * i; j <= 55555; j += i) { isPrime[j] = false; } } } int n; scanf("%d", &n); for (int i = 0; i < n; i++) { if (i) printf(" "); printf("%d", primes[i]); } printf("\n"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Five, Five Everywhere |
User | pauljgblt |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 507 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 384 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:20:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^
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 | 384 KB |
in02.txt | AC | 2 ms | 384 KB |
sample_01.txt | AC | 2 ms | 384 KB |
sample_02.txt | AC | 2 ms | 384 KB |
sample_03.txt | AC | 2 ms | 384 KB |