結果
問題 |
No.537 ユーザーID
|
ユーザー |
![]() |
提出日時 | 2017-07-01 13:01:50 |
言語 | Java (openjdk 23) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,193 bytes |
コンパイル時間 | 2,482 ms |
コンパイル使用メモリ | 78,760 KB |
実行使用メモリ | 78,536 KB |
最終ジャッジ日時 | 2024-10-05 03:29:15 |
合計ジャッジ時間 | 8,296 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 TLE * 1 -- * 15 |
ソースコード
package yukicoder; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long[] x1 = new long [1000000]; long[] x2 = new long [1000000]; int cnt = 0; for(long i = 1 ; ; i++){ if((n%i)==0){ long ans = n / i ; if(ans > i){ x1[cnt] = ans; x2[cnt] = i; cnt++; }else if(ans == i){ x1[cnt] = ans; x2[cnt] = i; cnt++; break ; }else{ break ; } } } String comb[] = new String[cnt*2+1]; int x = 0; for(int i = 0 ; i < cnt ; i++){ boolean flg = true; String str = Long.toString(x1[i]) + Long.toString(x2[i]); for(int j = 0 ; j < x ; j++){ if(str.equals(comb[j])){ flg = false; break; } } if(flg){ comb[x] = str; x++; } flg = true; if(x1[i] != x2[i]){ str = Long.toString(x2[i]) + Long.toString(x1[i]); for(int j = 0 ; j < x ; j++){ if(str.equals(comb[j])){ flg = false; break; } } if(flg){ comb[x] = str; x++; } } } System.out.println(x); } }