<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sugarknri</author_name>
  <author_url>https://blog.hatena.ne.jp/sugarknri/</author_url>
  <blog_title>メモ</blog_title>
  <blog_url>https://sugarknri.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>問題はこちら No.300 平方数 - yukicoder「平方数⇔素因数分解した時の指数が全て偶数」なので、Xを素因数分解して、指数が奇数のものを掛けあわせれば良い 最悪でもX自身をかければ平方数になるので、Y≦X≦10^12 int main(){ long x,y=1,i,p; scanf(&quot;%ld&quot;,&amp;x); for(p=2;p*p&lt;=x;p++)if(x%p==0){ i=0; while(x%p==0){ x/=p; i++; } if(i%2==1)y*=p; } printf(&quot;%ld&quot;,y); return 0; } Xを素因数分解した時の指数が全て1ならYとしてX自身を取る…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsugarknri.hatenablog.com%2Fentry%2F2016%2F05%2F24%2F162244&quot; title=&quot;yukicoder No.300 平方数 - メモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-05-24 16:22:44</published>
  <title>yukicoder No.300 平方数</title>
  <type>rich</type>
  <url>https://sugarknri.hatenablog.com/entry/2016/05/24/162244</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
