結果
問題 |
No.432 占い(Easy)
|
ユーザー |
|
提出日時 | 2016-10-21 23:12:52 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 214 ms / 2,000 ms |
コード長 | 738 bytes |
コンパイル時間 | 2,808 ms |
コンパイル使用メモリ | 74,520 KB |
実行使用メモリ | 42,496 KB |
最終ジャッジ日時 | 2024-11-23 16:50:18 |
合計ジャッジ時間 | 7,871 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int loop = 0; loop < T; loop++) { char[] str = sc.next().toCharArray(); int[] s = new int[str.length]; for (int i = 0; i < str.length; i++) s[i] = str[i] - '0'; int N = s.length; while (N > 1) { for (int i = 0; i < N - 1; i++) { s[i] = s[i] + s[i+1]; if (s[i] >= 10) s[i] = 1 + s[i] % 10; } N--; } System.out.println(s[0]); } } }