結果

問題 No.671 1000000007
ユーザー Mcpu3Mcpu3
提出日時 2018-04-15 12:44:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 2,042 ms
コンパイル使用メモリ 72,952 KB
実行使用メモリ 56,084 KB
最終ジャッジ日時 2023-09-09 05:42:31
合計ジャッジ時間 4,192 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,868 KB
testcase_01 AC 124 ms
55,900 KB
testcase_02 AC 124 ms
55,892 KB
testcase_03 AC 125 ms
55,724 KB
testcase_04 AC 124 ms
55,588 KB
testcase_05 AC 123 ms
55,972 KB
testcase_06 AC 123 ms
55,808 KB
testcase_07 AC 123 ms
56,084 KB
testcase_08 AC 125 ms
55,736 KB
testcase_09 AC 123 ms
55,960 KB
testcase_10 AC 123 ms
55,432 KB
testcase_11 AC 124 ms
56,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no671{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		long n=stdIn.nextLong();
		int i=0;
		while(n!=0) {
			n=n/10;
			i++;
		}
		int ans;
		if(i==10) ans=0;
		else if(i>10) ans=i-10;
		else ans=10-i;
		System.out.println(ans);
	}
}
0