結果
問題 | No.300 平方数 |
ユーザー |
![]() |
提出日時 | 2015-11-25 00:18:53 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 1,000 ms |
コード長 | 468 bytes |
コンパイル時間 | 128 ms |
コンパイル使用メモリ | 20,864 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 17:22:39 |
合計ジャッジ時間 | 1,345 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:23:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 23 | scanf("%lld", &X); | ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> typedef unsigned long long uint64; inline static void f(uint64 *X, uint64 *Y, uint64 i) { uint64 n=0; uint64 x=*X; while ((x%i)==0) { n^=1; x/=i; } (*Y)*=(n&1)?i:1; *X=x; return; } int main(){ uint64 X; uint64 Y=1; uint64 i=2; scanf("%lld", &X); f(&X, &Y, i); i++; while ((i*i)<=X) { f(&X, &Y, i); i+=2; } printf ("%lld\n", X*Y); return 0; }