結果
問題 | No.2729 Addition and Multiplication in yukicoder (Easy) |
ユーザー |
![]() |
提出日時 | 2024-04-19 21:25:01 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 530 ms / 2,000 ms |
コード長 | 611 bytes |
コンパイル時間 | 2,979 ms |
コンパイル使用メモリ | 74,920 KB |
実行使用メモリ | 66,416 KB |
最終ジャッジ日時 | 2024-10-11 13:52:30 |
合計ジャッジ時間 | 11,795 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
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);}}