結果

問題 No.146 試験監督(1)
ユーザー 37zigen37zigen
提出日時 2016-03-31 11:51:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 963 ms / 1,000 ms
コード長 428 bytes
コンパイル時間 1,877 ms
コンパイル使用メモリ 74,492 KB
実行使用メモリ 69,100 KB
最終ジャッジ日時 2024-04-10 06:43:47
合計ジャッジ時間 6,273 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 941 ms
69,100 KB
testcase_01 AC 936 ms
68,636 KB
testcase_02 AC 963 ms
69,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder146;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		long sum=0;
		long mod=(long)Math.pow(10, 9)+7;
		for(int i=0;i<n;i++){
			long c=sc.nextLong();//C個の椅子がある机が
			long d=sc.nextLong()%mod;//D個ある。
			sum+=((((c+1)/2)%mod)*d)%mod;
			sum=sum%mod;
		}
		System.out.println(sum);
	}
}
0