結果
問題 | No.491 10^9+1と回文 |
ユーザー |
|
提出日時 | 2017-03-21 16:00:50 |
言語 | Java (openjdk 23) |
結果 |
TLE
|
実行時間 | - |
コード長 | 504 bytes |
コンパイル時間 | 3,253 ms |
コンパイル使用メモリ | 74,660 KB |
実行使用メモリ | 65,040 KB |
最終ジャッジ日時 | 2024-07-05 06:03:21 |
合計ジャッジ時間 | 8,551 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | WA * 2 TLE * 1 MLE * 1 -- * 99 |
ソースコード
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);}}