Submission #117012


Source Code Expand

// Enjoy your stay.

#include <bits/stdc++.h>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define mt make_tuple
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)(x).size())

using namespace std;

typedef istringstream iss;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef stringstream sst;
typedef vector<ll> vi;

int n;

int main2(){
	int ans=0;
	for(int i=2;i*i<=n;i++)if(n%i==0){
		ans=i;
		while(n%i==0)n/=i;
	}
	cout<<max(ans,n)<<endl;
	return 0;
}

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	while(cin>>n && n){
		main2();
	}
}

Submission Info

Submission Time
Task B - Working for the World
User evima
Language C++ (G++ 4.6.4)
Score 100
Code Size 832 Byte
Status AC
Exec Time 26 ms
Memory 948 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 26 ms 948 KB
10-minimum AC 23 ms 916 KB
11-maximum AC 25 ms 816 KB
12-little AC 22 ms 920 KB
13-large AC 21 ms 920 KB
14-middle AC 24 ms 916 KB
15-zero AC 23 ms 916 KB
50-random00 AC 25 ms 916 KB
50-random01 AC 23 ms 912 KB
50-random02 AC 22 ms 920 KB
50-random03 AC 25 ms 912 KB
50-random04 AC 22 ms 928 KB
50-random05 AC 22 ms 920 KB
50-random06 AC 25 ms 916 KB
50-random07 AC 24 ms 916 KB
50-random08 AC 24 ms 912 KB
50-random09 AC 23 ms 920 KB
50-random10 AC 23 ms 880 KB
50-random11 AC 24 ms 916 KB
50-random12 AC 24 ms 836 KB
50-random13 AC 22 ms 840 KB
50-random14 AC 20 ms 920 KB
50-random15 AC 25 ms 892 KB
50-random16 AC 22 ms 916 KB
50-random17 AC 23 ms 924 KB
50-random18 AC 22 ms 924 KB
50-random19 AC 22 ms 920 KB