結果

問題 No.537 ユーザーID
ユーザー Shun_PIShun_PI
提出日時 2017-06-30 22:34:56
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 2,081 bytes
コンパイル時間 3,246 ms
コンパイル使用メモリ 78,248 KB
実行使用メモリ 59,028 KB
最終ジャッジ日時 2024-04-15 06:34:01
合計ジャッジ時間 7,470 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
56,720 KB
testcase_01 AC 57 ms
49,656 KB
testcase_02 AC 56 ms
49,736 KB
testcase_03 AC 55 ms
49,996 KB
testcase_04 AC 59 ms
49,728 KB
testcase_05 AC 57 ms
49,960 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 59 ms
50,000 KB
testcase_10 AC 58 ms
49,740 KB
testcase_11 AC 58 ms
49,752 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 56 ms
50,100 KB
testcase_19 AC 58 ms
50,012 KB
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
 
public class Main {
	private static FastScanner sc = new FastScanner();
	
	public static void main(String[] args) {
		long N = sc.nextLong();
		
		long c = 1;
		for(int i=2; i*i<=N; i++) {
			int j = 1;
			 while(N % i == 0) {
				 N /= i;
				 j++;
			 }
			 c *= j;
		}
		
		if(1 < N) {
			System.out.println(c * 2);
		} else {
			System.out.println(c);
		}
	}
	
	static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
}
0