CSES - Leirikisa 2 - Results
Submission details
Task:Alkuluku
Sender:siirikuoppala
Submission time:2016-07-28 14:41:58 +0300
Language:C++
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#2ACCEPTED0.04 sdetails
#3ACCEPTED0.04 sdetails
#4ACCEPTED0.03 sdetails
#5ACCEPTED0.05 sdetails
#6ACCEPTED0.04 sdetails
#7ACCEPTED0.04 sdetails
#8ACCEPTED0.05 sdetails
#9ACCEPTED0.04 sdetails
#10ACCEPTED0.04 sdetails
#11ACCEPTED0.05 sdetails

Code

#include <iostream>

using namespace std;

int t[1010];
int main(){
    int n;
    cin >> n;
    ++n;
    for(int i=2; i*i<2*n; ++i){
        for(int j=max((n/i)*i, i*i); j<n+1000; j+=i){
            if(j-n>=0)t[j-n]=1;
        }
    }
    for(int i=0; i<1000; ++i){
        if(t[i]==0){
            cout << i+n;
            return 0;
        }
    }

}

Test details

Test 1

Verdict: ACCEPTED

input
267201760

correct output
267201811

user output
267201811

Test 2

Verdict: ACCEPTED

input
382365302

correct output
382365311

user output
382365311

Test 3

Verdict: ACCEPTED

input
922256703

correct output
922256707

user output
922256707

Test 4

Verdict: ACCEPTED

input
222350429

correct output
222350431

user output
222350431

Test 5

Verdict: ACCEPTED

input
425069279

correct output
425069287

user output
425069287

Test 6

Verdict: ACCEPTED

input
926005779

correct output
926005781

user output
926005781

Test 7

Verdict: ACCEPTED

input
422228751

correct output
422228761

user output
422228761

Test 8

Verdict: ACCEPTED

input
53852719

correct output
53852731

user output
53852731

Test 9

Verdict: ACCEPTED

input
347245593

correct output
347245603

user output
347245603

Test 10

Verdict: ACCEPTED

input
499175986

correct output
499176001

user output
499176001

Test 11

Verdict: ACCEPTED

input
8

correct output
11

user output
11