結果
問題 | No.300 平方数 |
ユーザー | smiken_61 |
提出日時 | 2018-03-05 15:07:00 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 13 ms / 1,000 ms |
コード長 | 9,391 bytes |
コンパイル時間 | 1,655 ms |
コンパイル使用メモリ | 165,092 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-21 07:12:10 |
合計ジャッジ時間 | 3,693 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 12 ms
5,248 KB |
testcase_01 | AC | 13 ms
5,376 KB |
testcase_02 | AC | 13 ms
5,376 KB |
testcase_03 | AC | 13 ms
5,376 KB |
testcase_04 | AC | 13 ms
5,376 KB |
testcase_05 | AC | 13 ms
5,376 KB |
testcase_06 | AC | 12 ms
5,376 KB |
testcase_07 | AC | 13 ms
5,376 KB |
testcase_08 | AC | 12 ms
5,376 KB |
testcase_09 | AC | 13 ms
5,376 KB |
testcase_10 | AC | 13 ms
5,376 KB |
testcase_11 | AC | 13 ms
5,376 KB |
testcase_12 | AC | 13 ms
5,376 KB |
testcase_13 | AC | 13 ms
5,376 KB |
testcase_14 | AC | 13 ms
5,376 KB |
testcase_15 | AC | 13 ms
5,376 KB |
testcase_16 | AC | 13 ms
5,376 KB |
testcase_17 | AC | 13 ms
5,376 KB |
testcase_18 | AC | 13 ms
5,376 KB |
testcase_19 | AC | 12 ms
5,376 KB |
testcase_20 | AC | 12 ms
5,376 KB |
testcase_21 | AC | 13 ms
5,376 KB |
testcase_22 | AC | 13 ms
5,376 KB |
testcase_23 | AC | 13 ms
5,376 KB |
testcase_24 | AC | 13 ms
5,376 KB |
testcase_25 | AC | 13 ms
5,376 KB |
testcase_26 | AC | 13 ms
5,376 KB |
testcase_27 | AC | 12 ms
5,376 KB |
testcase_28 | AC | 13 ms
5,376 KB |
testcase_29 | AC | 13 ms
5,376 KB |
testcase_30 | AC | 13 ms
5,376 KB |
testcase_31 | AC | 13 ms
5,376 KB |
testcase_32 | AC | 12 ms
5,376 KB |
testcase_33 | AC | 13 ms
5,376 KB |
testcase_34 | AC | 13 ms
5,376 KB |
testcase_35 | AC | 12 ms
5,376 KB |
testcase_36 | AC | 13 ms
5,376 KB |
testcase_37 | AC | 12 ms
5,376 KB |
testcase_38 | AC | 13 ms
5,376 KB |
testcase_39 | AC | 13 ms
5,376 KB |
testcase_40 | AC | 13 ms
5,376 KB |
testcase_41 | AC | 12 ms
5,376 KB |
testcase_42 | AC | 13 ms
5,376 KB |
testcase_43 | AC | 12 ms
5,376 KB |
testcase_44 | AC | 13 ms
5,376 KB |
testcase_45 | AC | 13 ms
5,376 KB |
ソースコード
#include <bits/stdc++.h> #include<iostream> #include<cstdio> #include<vector> #include<queue> #include<map> #include<cstring> #include<string> #include <math.h> #include<algorithm> // #include <boost/multiprecision/cpp_int.hpp> #include<functional> #define int long long #define inf 1000000007 #define pa pair<int,int> #define ll long long #define pal pair<double,pa> #define ppa pair<string,int> #define ppap pair<int,pa> #define ssa pair<string,int> #define mp make_pair #define pb push_back #define EPS (1e-12) #define equals(a,b) (fabs((a)-(b))<EPS) #define VI vector<int> using namespace std; class pas{ public: int x,y; pas(int x=0,int y=0):x(x),y(y) {} pas operator + (pas p) {return pas(x+p.x,y+p.y);} pas operator - (pas p) {return pas(x-p.x,y-p.y);} pas operator * (int a) {return pas(x*a,y*a);} pas operator / (int a) {return pas(x/a,y/a);} // double absv() {return sqrt(norm());} int norm() {return x*x+y*y;} bool operator < (const pas &p) const{ return x != p.x ? x<p.x: y<p.y; } // bool operator < (const pas &p) const{ // return y != p.y ? y<p.y: x<p.x; // } bool operator == (const pas &p) const{ return x==p.x && y==p.y; } }; class Point{ public: double x,y; Point(double x=0,double y=0):x(x),y(y) {} Point operator + (Point p) {return Point(x+p.x,y+p.y);} Point operator - (Point p) {return Point(x-p.x,y-p.y);} Point operator * (double a) {return Point(x*a,y*a);} Point operator / (double a) {return Point(x/a,y/a);} double absv() {return sqrt(norm());} double norm() {return x*x+y*y;} bool operator < (const Point &p) const{ return x != p.x ? x<p.x: y<p.y; } bool operator == (const Point &p) const{ return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS; } }; typedef Point Vector; #define pl pair<int,pas> struct Segment{ Point p1,p2; }; struct star{ Segment se[5]; }; double dot(Vector a,Vector b){ return a.x*b.x+a.y*b.y; } double cross(Vector a,Vector b){ return a.x*b.y-a.y*b.x; } bool parareru(Point a,Point b,Point c,Point d){ // if(abs(cross(a-b,d-c))<EPS)cout<<"dd "<<cross(a-b,d-c)<<endl; return abs(cross(a-b,d-c))<EPS; } double distance_ls_p(Point a, Point b, Point c) { if ( dot(b-a, c-a) < EPS ) return (c-a).absv(); if ( dot(a-b, c-b) < EPS ) return (c-b).absv(); return abs(cross(b-a, c-a)) / (b-a).absv(); } bool is_intersected_ls(Segment a,Segment b) { if(a.p1==b.p1||a.p2==b.p1||a.p1==b.p2||a.p2==b.p2) return false; if(parareru((a.p2),(a.p1),(b.p1),(b.p2))&¶reru((a.p2),(a.p1),(b.p1),(b.p1))){ // cout<<"sss"<<endl; if(dot(a.p1-b.p1,a.p1-b.p2)<EPS) return true; if(dot(a.p2-b.p1,a.p2-b.p2)<EPS) return true; if(dot(a.p1-b.p1,a.p2-b.p1)<EPS) return true; if(dot(a.p1-b.p2,a.p2-b.p2)<EPS) return true; return false; } else return ( cross(a.p2-a.p1, b.p1-a.p1) * cross(a.p2-a.p1, b.p2-a.p1) < EPS ) && ( cross(b.p2-b.p1, a.p1-b.p1) * cross(b.p2-b.p1, a.p2-b.p1) < EPS ); } double segment_len(Segment a){ return (a.p1-a.p2).absv(); } double segment_dis(Segment a,Segment b){ if(is_intersected_ls(a,b))return 0; double r=distance_ls_p(a.p1, a.p2, b.p1); r=min(r,distance_ls_p(a.p1, a.p2, b.p2)); r=min(r,distance_ls_p(b.p1, b.p2, a.p2)); r=min(r,distance_ls_p(b.p1, b.p2, a.p1)); return r; } Point intersection_ls(Segment a, Segment b) { Point ba = b.p2-b.p1; double d1 = abs(cross(ba, a.p1-b.p1)); double d2 = abs(cross(ba, a.p2-b.p1)); double t = d1 / (d1 + d2); return a.p1 + (a.p2-a.p1) * t; } pair<Point,Point> circle_intersection(Point c1,double r1,Point c2,double r2){ double d=(c1-c2).absv(); double h=(r1*r1-r2*r2+d*d)/2.0/d; double l=sqrt(r1*r1-h*h); // cout<<d<<" "<<h<<" "<<l<<endl; Point asi=c1+(c2-c1)*h/((c2-c1).absv()); Vector r1r2=(c2-c1)/((c2-c1).absv()); Vector sui={r1r2.y,-r1r2.x}; // cout<<sui.x<<" "<<sui.y<<endl; pair<Point,Point> z=mp(asi+sui*l,asi-sui*l); if(z.first.x>z.second.x) swap(z.first,z.second); return z; } int gcd(int x,int y){ if(x<y) return gcd(y,x); if(x==y) return x; if(x%y==0) return y; return gcd(y,x%y); } int lcm(int x,int y){ int g=gcd(x,y); x=x/g; return x*y; } class pa2{ public: int x,y; pa2(int x=0,int y=0):x(x),y(y) {} pa2 operator + (pa2 p) {return pa2(x+p.x,y+p.y);} pa2 operator - (pa2 p) {return pa2(x-p.x,y-p.y);} bool operator < (const pa2 &p) const{ return x != p.x ? x<p.x: y<p.y; } bool operator > (const pa2 &p) const{ return x != p.x ? x>p.x: y>p.y; } bool operator == (const pa2 &p) const{ return abs(x-p.x)==0 && abs(y-p.y)==0; } bool operator != (const pa2 &p) const{ return !(abs(x-p.x)==0 && abs(y-p.y)==0); } }; int cc[4000][4000]; vector<int> ve,kosuu; signed main(){ int n; cin>>n; int nn=n; for(int i=2;i<=1000020;i++)if(nn%i==0){ int cnt=0; while(nn%i==0){ nn/=i; cnt++; } ve.pb(i); kosuu.pb(cnt); } if(nn>1){ ve.pb(nn); kosuu.pb(1); } int ans=1; for(int i=0;i<ve.size();i++){ if(kosuu[i]%2)ans*=ve[i]; } cout<<ans<<endl; return 0; }