Submission #117442


Source Code Expand

#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	ll n;
	while(cin>>n,n){
		ll ans = 2;
		for(ll i = 2;i*i<=n;i++){
			while(n%i==0){
				n /=i;
			}
			ans = i;
		}
		if(n!=1)
			ans = max(ans,n);
		cout <<ans<<endl;
	}
	return 0;
}

Submission Info

Submission Time
Task B - Working for the World
User togatoga
Language C++ (G++ 4.6.4)
Score 100
Code Size 1032 Byte
Status AC
Exec Time 22 ms
Memory 928 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 21 ms 924 KB
10-minimum AC 21 ms 800 KB
11-maximum AC 21 ms 920 KB
12-little AC 20 ms 924 KB
13-large AC 21 ms 920 KB
14-middle AC 22 ms 804 KB
15-zero AC 21 ms 916 KB
50-random00 AC 21 ms 672 KB
50-random01 AC 21 ms 796 KB
50-random02 AC 21 ms 800 KB
50-random03 AC 21 ms 796 KB
50-random04 AC 22 ms 800 KB
50-random05 AC 22 ms 800 KB
50-random06 AC 21 ms 924 KB
50-random07 AC 21 ms 796 KB
50-random08 AC 21 ms 804 KB
50-random09 AC 22 ms 920 KB
50-random10 AC 21 ms 796 KB
50-random11 AC 21 ms 796 KB
50-random12 AC 21 ms 924 KB
50-random13 AC 20 ms 920 KB
50-random14 AC 20 ms 924 KB
50-random15 AC 22 ms 800 KB
50-random16 AC 21 ms 792 KB
50-random17 AC 21 ms 792 KB
50-random18 AC 22 ms 696 KB
50-random19 AC 21 ms 928 KB