結果
問題 | No.146 試験監督(1) |
ユーザー |
![]() |
提出日時 | 2015-12-28 22:51:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 36 ms / 1,000 ms |
コード長 | 273 bytes |
コンパイル時間 | 211 ms |
コンパイル使用メモリ | 33,480 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 08:00:09 |
合計ジャッジ時間 | 1,199 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
コンパイルメッセージ
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); | ~~~~~^~~~~~~~~~~~~~~~~~
ソースコード
#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);}