結果
| 問題 |
No.537 ユーザーID
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-03 16:37:53 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 2,000 ms |
| コード長 | 713 bytes |
| コンパイル時間 | 199 ms |
| コンパイル使用メモリ | 22,016 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-05 12:24:27 |
| 合計ジャッジ時間 | 1,349 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:22:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
22 | scanf("%llu",&n);
| ^~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
unsigned long long int digit(unsigned long long int x){
int d=0;
while(x!=0){
x/=10;
d++;
}
return d;
}
unsigned long long int makex(unsigned long long int a,unsigned long long int b){
int i,d;
d = digit(b);
for(i = 1;i <= d;i++){a*=10;}
return a+b;
}
int main(void){
unsigned long long int n,r[131072]={0},c=0,x1,x2,i,j;
scanf("%llu",&n);
for(i = 1;i*i <= n;i++){
if(n%i != 0){continue;}
x1=makex(i,n/i);
x2=makex(n/i,i);
if(c == 0){r[1] = x1;c=1;}
for(j = 1;j <= c;j++){
if(r[j] == x1){break;}
if(j == c){c++;r[c] = x1;break;}
}
for(j = 1;j <= c;j++){
if(r[j] == x2){break;}
if(j == c){c++;r[c] = x2;break;}
}
}
printf("%llu\n",c);
return 0;
}