Submission #3042358


Source Code Expand

#include<cstdio>
using namespace std;
int GetMaxPrime(int n) 
{
	if(n==2) return n;
	int i=2;
	int res=1;
	while(n>2) 
	{
		if(n%i) i++;
		else n/=i,res=i;
	}
	return res;
}
int main()
{
	//freopen("xx.in","r",stdin);
	int n;
	while(scanf("%d",&n)&&n) printf("%d\n",GetMaxPrime(n));
    return 0;
}

Submission Info

Submission Time
Task B - Working for the World
User luogu_bot1
Language C++ (GCC 5.4.1)
Score 100
Code Size 318 Byte
Status AC
Exec Time 766 ms
Memory 128 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 27
Set Name Test Cases
All 00-sample, 10-minimum, 11-maximum, 12-little, 13-large, 14-middle, 15-zero, 50-random00, 50-random01, 50-random02, 50-random03, 50-random04, 50-random05, 50-random06, 50-random07, 50-random08, 50-random09, 50-random10, 50-random11, 50-random12, 50-random13, 50-random14, 50-random15, 50-random16, 50-random17, 50-random18, 50-random19
Case Name Status Exec Time Memory
00-sample AC 1 ms 128 KB
10-minimum AC 0 ms 128 KB
11-maximum AC 0 ms 128 KB
12-little AC 0 ms 128 KB
13-large AC 766 ms 128 KB
14-middle AC 1 ms 128 KB
15-zero AC 0 ms 128 KB
50-random00 AC 319 ms 128 KB
50-random01 AC 193 ms 128 KB
50-random02 AC 611 ms 128 KB
50-random03 AC 136 ms 128 KB
50-random04 AC 172 ms 128 KB
50-random05 AC 748 ms 128 KB
50-random06 AC 566 ms 128 KB
50-random07 AC 81 ms 128 KB
50-random08 AC 89 ms 128 KB
50-random09 AC 582 ms 128 KB
50-random10 AC 46 ms 128 KB
50-random11 AC 409 ms 128 KB
50-random12 AC 107 ms 128 KB
50-random13 AC 311 ms 128 KB
50-random14 AC 251 ms 128 KB
50-random15 AC 153 ms 128 KB
50-random16 AC 238 ms 128 KB
50-random17 AC 254 ms 128 KB
50-random18 AC 665 ms 128 KB
50-random19 AC 59 ms 128 KB