結果
問題 | No.369 足し間違い |
ユーザー | Grenache |
提出日時 | 2016-05-22 12:06:56 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 106 ms / 2,000 ms |
コード長 | 1,477 bytes |
コンパイル時間 | 3,839 ms |
コンパイル使用メモリ | 78,884 KB |
実行使用メモリ | 39,516 KB |
最終ジャッジ日時 | 2024-04-16 06:18:59 |
合計ジャッジ時間 | 4,987 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 54 ms
37,164 KB |
testcase_01 | AC | 56 ms
37,308 KB |
testcase_02 | AC | 53 ms
37,164 KB |
testcase_03 | AC | 54 ms
37,100 KB |
testcase_04 | AC | 100 ms
39,232 KB |
testcase_05 | AC | 59 ms
36,764 KB |
testcase_06 | AC | 99 ms
39,296 KB |
testcase_07 | AC | 106 ms
39,516 KB |
ソースコード
import java.io.*; import java.util.*; public class Main_yukicoder369 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Printer pr = new Printer(System.out); int n = sc.nextInt(); int sum = 0; for (int i = 0; i < n; i++) { sum += sc.nextInt(); } int v = sc.nextInt(); pr.println(sum - v); pr.close(); sc.close(); } @SuppressWarnings("unused") private static class Scanner { BufferedReader br; Iterator<String> it; Scanner (InputStream in) { br = new BufferedReader(new InputStreamReader(in)); } String next() throws RuntimeException { try { if (it == null || !it.hasNext()) { it = Arrays.asList(br.readLine().split(" ")).iterator(); } return it.next(); } catch (IOException e) { throw new IllegalStateException(); } } int nextInt() throws RuntimeException { return Integer.parseInt(next()); } long nextLong() throws RuntimeException { return Long.parseLong(next()); } float nextFloat() throws RuntimeException { return Float.parseFloat(next()); } double nextDouble() throws RuntimeException { return Double.parseDouble(next()); } void close() { try { br.close(); } catch (IOException e) { // throw new IllegalStateException(); } } } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }