結果

問題 No.146 試験監督(1)
ユーザー piyoko_212piyoko_212
提出日時 2015-12-28 22:51:16
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 39 ms / 1,000 ms
コード長 273 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 33,508 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 11:54:32
合計ジャッジ時間 1,091 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
4,348 KB
testcase_01 AC 39 ms
4,348 KB
testcase_02 AC 39 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         int a;scanf("%d",&a);
      |               ~~~~~^~~~~~~~~
main.cpp:10:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |                 scanf("%lld%lld",&p,&q);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<algorithm>
using namespace std;
long long mod=1000000007;
int main(){
	int a;scanf("%d",&a);
	long long ret=0;
	while(a--){
		long long p,q;
		scanf("%lld%lld",&p,&q);
		p=(p+1)/2;
		p%=mod;q%=mod;
		ret=(ret+p*q)%mod;
	}
	printf("%lld\n",ret);
}
0