結果
| 問題 | 
                            No.146 試験監督(1)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2015-06-10 23:34:44 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 920 ms / 1,000 ms | 
| コード長 | 506 bytes | 
| コンパイル時間 | 3,577 ms | 
| コンパイル使用メモリ | 75,876 KB | 
| 実行使用メモリ | 73,788 KB | 
| 最終ジャッジ日時 | 2024-07-06 15:28:36 | 
| 合計ジャッジ時間 | 7,163 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 | 
ソースコード
import java.util.Scanner;
public class Test{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n;
		n = sc.nextInt();
		Long res = (long)0;
		Long[] c = new Long[n];
		Long[] d = new Long[n];
		for(int i = 0;i<n;i++){
			c[i] = sc.nextLong();
			if(c[i] % 2 == 0){
				c[i] = (c[i] / 2) % 1000000007;
			}else{
				c[i] = (c[i] / 2 +1) % 1000000007;
			}
			d[i] = sc.nextLong() % 1000000007;
			res = (res + c[i] * d[i] )% 1000000007;
		}
		System.out.println(res);
	}
}