結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
👑tozangezan
|
| 提出日時 | 2015-02-22 16:30:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 1,000 ms |
| コード長 | 274 bytes |
| コンパイル時間 | 324 ms |
| コンパイル使用メモリ | 33,612 KB |
| 実行使用メモリ | 6,940 KB |
| 最終ジャッジ日時 | 2024-06-23 21:50:49 |
| 合計ジャッジ時間 | 957 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
int mod=1000000007;
int main(){
int a;scanf("%d",&a);
long long ret=0;
for(int i=0;i<a;i++){
long long p,q;
scanf("%lld%lld",&p,&q);
q%=mod;
p=(p+1)/2%mod;
ret=(ret+p*q)%mod;
}
printf("%lld\n",ret);
}
👑tozangezan