結果

問題 No.2729 Addition and Multiplication in yukicoder (Easy)
ユーザー ks2mks2m
提出日時 2024-04-19 21:25:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 475 ms / 2,000 ms
コード長 611 bytes
コンパイル時間 2,645 ms
コンパイル使用メモリ 75,892 KB
実行使用メモリ 79,372 KB
最終ジャッジ日時 2024-04-19 21:25:23
合計ジャッジ時間 9,467 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
50,264 KB
testcase_01 AC 48 ms
50,088 KB
testcase_02 AC 321 ms
75,528 KB
testcase_03 AC 343 ms
70,336 KB
testcase_04 AC 378 ms
71,136 KB
testcase_05 AC 366 ms
71,128 KB
testcase_06 AC 475 ms
78,828 KB
testcase_07 AC 470 ms
73,516 KB
testcase_08 AC 333 ms
77,980 KB
testcase_09 AC 51 ms
50,296 KB
testcase_10 AC 50 ms
50,272 KB
testcase_11 AC 53 ms
50,004 KB
testcase_12 AC 474 ms
79,372 KB
testcase_13 AC 455 ms
78,828 KB
testcase_14 AC 469 ms
78,176 KB
testcase_15 AC 446 ms
79,044 KB
testcase_16 AC 413 ms
69,344 KB
testcase_17 AC 386 ms
69,124 KB
testcase_18 AC 463 ms
69,336 KB
testcase_19 AC 392 ms
68,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] sa = br.readLine().split(" ");
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(sa[i]);
		}
		br.close();

		Arrays.sort(a);
		int mod = 998244353;
		long ans = 0;
		for (int i = 0; i < n; i++) {
			ans *= 10;
			ans += a[i];
			ans %= mod;
		}
		System.out.println(ans);
	}
}
0