結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
dgd1724
|
| 提出日時 | 2016-09-24 06:51:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 938 bytes |
| コンパイル時間 | 654 ms |
| コンパイル使用メモリ | 94,356 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-17 20:27:06 |
| 合計ジャッジ時間 | 1,574 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
ソースコード
#define _USE_MATH_DEFINES //M_PI
#include <iostream> //std::cout, std::cin
#include <string> //std::string
#include <vector> //std::vector
#include <valarray> //std::valarray 数値のみの一次配列
#include <algorithm> //std::sort
#include <time.h> //localtime_s
#include <cstdlib> //abs
#include <cmath> //abs, std::pow, sqrt, sin, cos,round,floor
#include <fstream> //std::ifstream
#include <iomanip> //std::setprecision
#include <random> //std::random(C++11)
#include <numeric> //std::accumulate
int main(void) {
//test用
//std::ifstream in("test.txt");
//std::cin.rdbuf(in.rdbuf());
//MODULO 10^9+7用
const unsigned int M = 1000000007;
int N;
std::cin >> N;
unsigned long long ans = 0;
unsigned long long C, D;
for (int i = 0; i < N; i++) {
std::cin >> C >> D;
if (C % 2 == 0) {
ans += C / 2 * D;
}
else {
ans += (C / 2 + 1)*D;
}
}
std::cout << ans%M << std::endl;
}
dgd1724