Saratov State University :: Online Contester


::Go
- home
- news
- register
- update personal info
- problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- links
- projects

::Poll
Are you registered on Codeforces?
Yes
No
What is it???

[results]

::webboard

Presentation Error on test 1
Author: ata
ID: 059912
Problem: 113
Contest: 0
Date: 2014-01-26 16:12:02

what's the problem with this code?


#include <cstdio>

using namespace std;

long long a,n[10];

bool prime(int m)
{
for(int i=2;i*i<=m;i++)
if(!(m%i))
return false;
return true;
}

bool nearly_prime(int m)
{
for(int i=2;i*i<=m;i++)
{
if(m%i==0&&prime(i)&&prime(m/i))
return true;
}
return false;
}

int main()
{
scanf("%d",&a);
for(int i=0;i<a;i++)
scanf("%d",&n[i]);

for(int i=0;i<a;i++)
if(nearly_prime(n[i]))
printf("yesn");
else
printf("Non");
return 0;
}


see sub-tree reply to that message


::Login
Forgot password?

::News
22.10.12 - The problems from the Southern Subregional Programming Contest 2012 added to the problemset archive (542 - 553).
22.10.12 - After the start of the contest the statements in PDF will be available by the link.
23.10.11 - The problems from the Southern Subregional Programming Contest 2011 added to the problemset archive (530 - 541).

::Counter

Server time: 2017-09-22 21:09:39Online Contester Team © 2002 - 2016. All rights reserved.