結果

問題 No.537 ユーザーID
ユーザー syuki791syuki791
提出日時 2017-07-02 14:27:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 382 ms / 2,000 ms
コード長 997 bytes
コンパイル時間 2,447 ms
コンパイル使用メモリ 80,744 KB
実行使用メモリ 59,076 KB
最終ジャッジ日時 2024-04-15 11:59:18
合計ジャッジ時間 9,653 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
53,804 KB
testcase_01 AC 131 ms
54,340 KB
testcase_02 AC 131 ms
53,844 KB
testcase_03 AC 131 ms
54,044 KB
testcase_04 AC 130 ms
53,844 KB
testcase_05 AC 131 ms
54,504 KB
testcase_06 AC 132 ms
54,008 KB
testcase_07 AC 130 ms
54,132 KB
testcase_08 AC 129 ms
54,212 KB
testcase_09 AC 129 ms
54,100 KB
testcase_10 AC 130 ms
54,280 KB
testcase_11 AC 129 ms
53,932 KB
testcase_12 AC 130 ms
54,236 KB
testcase_13 AC 133 ms
54,056 KB
testcase_14 AC 134 ms
53,972 KB
testcase_15 AC 124 ms
52,532 KB
testcase_16 AC 131 ms
54,224 KB
testcase_17 AC 134 ms
54,140 KB
testcase_18 AC 186 ms
56,144 KB
testcase_19 AC 149 ms
54,088 KB
testcase_20 AC 155 ms
54,120 KB
testcase_21 AC 181 ms
55,444 KB
testcase_22 AC 196 ms
56,116 KB
testcase_23 AC 197 ms
55,772 KB
testcase_24 AC 143 ms
54,280 KB
testcase_25 AC 199 ms
56,544 KB
testcase_26 AC 200 ms
56,280 KB
testcase_27 AC 183 ms
56,032 KB
testcase_28 AC 290 ms
57,212 KB
testcase_29 AC 382 ms
59,076 KB
testcase_30 AC 353 ms
58,824 KB
testcase_31 AC 181 ms
55,268 KB
testcase_32 AC 179 ms
55,188 KB
testcase_33 AC 346 ms
58,904 KB
testcase_34 AC 202 ms
56,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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);
		
	}

}
0