結果
| 問題 |
No.537 ユーザーID
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-02 14:27:43 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 392 ms / 2,000 ms |
| コード長 | 997 bytes |
| コンパイル時間 | 2,848 ms |
| コンパイル使用メモリ | 80,300 KB |
| 実行使用メモリ | 60,336 KB |
| 最終ジャッジ日時 | 2024-10-05 07:33:25 |
| 合計ジャッジ時間 | 10,662 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
import java.util.Scanner;
import java.util.ArrayList;
public class Main {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
String str = s.next();
s.close();
long n = Long.parseLong(str);
long count = 0;
long heihou = (long) Math.floor(Math.sqrt((double)n));
ArrayList<Long> lList = new ArrayList<Long>();
boolean b1;
boolean b2;
String s1;
String s2;
long n1;
long n2;
for(long i= 1;i<=heihou;i++){
if(n%i==0){
s1 = String.valueOf(i);
s2 = String.valueOf(n/i);
n1 = Long.parseLong(s1+s2);
n2 = Long.parseLong(s2+s1);
b1 = true;
b2 = true;
for(long l:lList){
if(l == n1){
b1 = false;
break;
}
}
if(b1){
count++;
lList.add(n1);
}
if(n1 != n2){
for(long l:lList){
if(l == n2){
b2 = false;
break;
}
}
if(b2){
count++;
lList.add(n2);
}
}
}
}
System.out.println(count);
}
}