QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#107296 | #3004. It's a Mod, Mod, Mod, Mod World | men3m | TL | 0ms | 0kb | C++23 | 967b | 2023-05-20 21:31:05 | 2023-05-20 21:31:09 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
const ld PI = acos(-1);
const ll N = 1e6 + 5, MOD = 1e9 + 7, oo = 2e9, OO = 2e18;
#define nl '\n'
#define sp ' '
#define F first
#define S second
#define EPS 1e-4
#define pb push_back
#define mkp make_pair
#define rz return 0;
#define rv return void
#define em emplace_back
#define sz(s) (ll)(s.size())
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Tests int test_cases; cin >> test_cases; for(int tc=1; tc<=test_cases; tc++)
#define WAAAAADY ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
void y3ni_mht3dee4() {
ll p, q, n, sum = 0;
cin >> p >> q >> n;
ll tmp_p = p;
for (int i = 1; i <= n; i++) {
// cout << p << sp;
sum += (p % q);
p += tmp_p;
}
cout << sum << nl;
}
signed main() {
WAAAAADY
Tests y3ni_mht3dee4();
}
详细
Test #1:
score: 0
Time Limit Exceeded
input:
91125 999956 999956 999956 999956 999956 999957 999956 999956 999958 999956 999956 999959 999956 999956 999960 999956 999956 999961 999956 999956 999962 999956 999956 999963 999956 999956 999964 999956 999956 999965 999956 999956 999966 999956 999956 999967 999956 999956 999968 999956 999956 999969 ...