結果
問題 |
No.146 試験監督(1)
|
ユーザー |
![]() |
提出日時 | 2018-02-17 00:42:20 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 467 bytes |
コンパイル時間 | 4,388 ms |
コンパイル使用メモリ | 75,460 KB |
実行使用メモリ | 59,840 KB |
最終ジャッジ日時 | 2024-06-23 16:54:46 |
合計ジャッジ時間 | 7,357 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 3 |
ソースコード
import java.util.Scanner; public class No146 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long C[] = new long[N]; long D[] = new long[N]; for(int i = 0;i < N;i++) { C[i] = sc.nextLong(); D[i] = sc.nextLong(); } long sum = 0; for(int i = 0;i < N;i++) { if(C[i]%2 == 0) { sum += C[i]/2 * D[i]; }else { sum += (C[i]/2 + 1) * D[i]; } } System.out.println(sum); } }