結果

問題 No.491 10^9+1と回文
コンテスト
ユーザー shinwisteria
提出日時 2017-03-21 16:00:50
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
MLE  
実行時間 -
コード長 504 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,685 ms
コンパイル使用メモリ 84,448 KB
実行使用メモリ 92,224 KB
最終ジャッジ日時 2026-03-26 12:57:07
合計ジャッジ時間 6,787 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 MLE * 1
other WA * 3 TLE * 1 -- * 99
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.Scanner;

public class Kaibun {
	static int count;

	public static void main(String[] args) throws InterruptedException {
		Scanner s = new Scanner(System.in);
		long t = (long)Math.pow(10, 9) +1 , N = s.nextLong();
		s.close();
		
		for(int i = 1;i <= (int)(N/t);i++){
			String str = Integer.toString(i);
			StringBuilder str2 = new StringBuilder(str);
			if(str.contentEquals(str2.reverse())){
				count++;
				if(i > 9){
					i += 9;
				}
			}
		}
		System.out.println(count);
	}
}
0