結果
問題 |
No.146 試験監督(1)
|
ユーザー |
|
提出日時 | 2016-03-31 11:29:09 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 494 bytes |
コンパイル時間 | 2,222 ms |
コンパイル使用メモリ | 74,164 KB |
実行使用メモリ | 71,604 KB |
最終ジャッジ日時 | 2024-10-02 08:22:57 |
合計ジャッジ時間 | 7,148 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 2 TLE * 1 |
ソースコード
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();//D個ある。 if(c%2==0){ sum+=(c/2)*d; sum=sum%mod; }else if(c%2==1){ sum+=((c/2)+1)*d; sum=sum%mod; } } System.out.println(sum); } }