結果
問題 | No.146 試験監督(1) |
ユーザー |
|
提出日時 | 2019-01-24 20:54:28 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 990 ms / 1,000 ms |
コード長 | 410 bytes |
コンパイル時間 | 3,438 ms |
コンパイル使用メモリ | 74,728 KB |
実行使用メモリ | 57,296 KB |
最終ジャッジ日時 | 2024-09-16 04:42:47 |
合計ジャッジ時間 | 8,108 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
import java.util.Scanner; public class No146 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); long tot = 0 , mod = (long)Math.pow(10, 9) + 7l; for(int i = 0;i < n;i++){ long c = s.nextLong() , d = s.nextLong(); long c2 = ((c + 1) / 2) % mod, d2 = d % mod; tot += c2 * d2; tot %= mod; } s.close(); System.out.println(tot); } }