Submission #6002421
Source Code Expand
#include<bits/stdc++.h> using namespace std; bool isprime(int n){ int m = sqrt(n); for(int i = 2; i <= m; i++){ if(n % i == 0) return 0; } return 1; } int main(){ int n; cin >> n; int k = 11; while(n){ if(isprime(k) && k % 10 == 1){ cout << k << ' '; n--; } k += 10; } cout << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Five, Five Everywhere |
User | I_dont_know |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 343 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 |