結果
| 問題 | 
                            No.146 試験監督(1)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2016-11-30 21:22:21 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 34 ms / 1,000 ms | 
| コード長 | 266 bytes | 
| コンパイル時間 | 125 ms | 
| コンパイル使用メモリ | 20,480 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-27 14:04:13 | 
| 合計ジャッジ時間 | 1,051 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%llu",&n);
      |         ^~~~~~~~~~~~~~~~
main.c:8:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |                 scanf("%llu%llu",&c,&d);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include<stdio.h>
#define K 1000000007
int main(void){
	unsigned long long int n,c,d,r=0,i;
	scanf("%llu",&n);
	for(i = 1;i <= n;i++){
		scanf("%llu%llu",&c,&d);
		if(c%2){c = (c+1)/2;}else{c/=2;}
		r+=(((c%K)*(d%K))%K);
		r%=K;
	}
	printf("%llu\n",r);
	return 0;
}