結果
| 問題 | 
                            No.300 平方数
                             | 
                    
| コンテスト | |
| ユーザー | 
                             notetonous
                         | 
                    
| 提出日時 | 2016-04-09 01:53:07 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 375 bytes | 
| コンパイル時間 | 189 ms | 
| コンパイル使用メモリ | 20,992 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-10-04 04:59:08 | 
| 合計ジャッジ時間 | 1,726 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 15 WA * 26 RE * 2 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |   scanf("%lld",&x);
      |   ^~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
int p[100000];
int main(){
  long long int x;
  long long int y=1;
  long long int i;
  long long int max;
  scanf("%lld",&x);
  for(i=2;i*i<=x;i++){
    while(x%i==0){
      x=x/i;
      p[i]++;
      max=i;
    }
  }
  if(x!=1)printf("%lld\n",x);
  else{
    for(i=2;i<=max;i++){
      if(p[i]%2==1)y=y*i;
    }
    printf("%lld\n",y);
  }
  return 0;
}
            
            
            
        
            
notetonous