結果

問題 No.432 占い(Easy)
ユーザー fjafjafjafjafjafja
提出日時 2017-09-10 00:58:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 688 bytes
コンパイル時間 3,921 ms
コンパイル使用メモリ 73,552 KB
実行使用メモリ 38,712 KB
最終ジャッジ日時 2024-04-25 00:57:06
合計ジャッジ時間 6,207 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
36,812 KB
testcase_01 AC 52 ms
36,636 KB
testcase_02 AC 53 ms
37,008 KB
testcase_03 AC 50 ms
36,856 KB
testcase_04 AC 50 ms
36,824 KB
testcase_05 AC 52 ms
37,032 KB
testcase_06 AC 55 ms
36,972 KB
testcase_07 AC 51 ms
36,636 KB
testcase_08 AC 52 ms
36,948 KB
testcase_09 AC 107 ms
38,452 KB
testcase_10 AC 59 ms
37,024 KB
testcase_11 AC 59 ms
36,724 KB
testcase_12 AC 86 ms
38,060 KB
testcase_13 AC 87 ms
38,388 KB
testcase_14 AC 58 ms
36,984 KB
testcase_15 AC 50 ms
37,092 KB
testcase_16 AC 51 ms
37,044 KB
testcase_17 AC 81 ms
38,012 KB
testcase_18 AC 89 ms
38,712 KB
testcase_19 AC 82 ms
38,056 KB
testcase_20 AC 63 ms
37,148 KB
testcase_21 AC 61 ms
37,036 KB
testcase_22 AC 60 ms
37,156 KB
testcase_23 AC 85 ms
37,796 KB
testcase_24 AC 106 ms
38,396 KB
testcase_25 AC 105 ms
38,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class N432
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int T=Integer.parseInt(br.readLine());
		for(int i=0;i<T;i++)
		{
			String str=br.readLine();
			int[] s=new int[str.length()];
			for(int j=0;j<str.length();j++)
			{
				s[j]=Integer.parseInt(str.substring(j, j+1));
			}
			for(int j=1;j<str.length();j++)
			{
				for(int k=0;k<str.length()-j;k++)
				{
					s[k]=s[k]+s[k+1];
					if(s[k]>=10){s[k]=1+s[k]%10;}
				}
			}
			System.out.println(s[0]);

		}
	}

}
0