結果
| 問題 | No.2757 Pin Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-24 00:03:27 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 620 bytes |
| 記録 | |
| コンパイル時間 | 1,828 ms |
| コンパイル使用メモリ | 81,648 KB |
| 実行使用メモリ | 60,152 KB |
| 最終ジャッジ日時 | 2026-05-27 16:15:48 |
| 合計ジャッジ時間 | 5,393 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 10 |
ソースコード
// No.2757 Pin Game
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] pins = new int[n];
for (int i = 0; i < n; i++) {
pins[i] = sc.nextInt();
}
int score = 0;
for (int i = 0; i < m; i++) {
int x = sc.nextInt();
int y = sc.nextInt();
if (pins[x - 1] > 0) {
score += y;
pins[x - 1]--;
}
}
System.out.println(score);
}
}