結果
問題 |
No.146 試験監督(1)
|
ユーザー |
![]() |
提出日時 | 2018-02-17 00:45:44 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 495 bytes |
コンパイル時間 | 3,455 ms |
コンパイル使用メモリ | 74,632 KB |
実行使用メモリ | 72,628 KB |
最終ジャッジ日時 | 2024-06-23 17:01:40 |
合計ジャッジ時間 | 7,635 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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]) % 1000000007; }else { sum += (C[i]/2 + 1) * D[i] % 1000000007; } } System.out.println(sum); } }