QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#107296#3004. It's a Mod, Mod, Mod, Mod Worldmen3mTL 0ms0kbC++23967b2023-05-20 21:31:052023-05-20 21:31:09

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-20 21:31:09]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2023-05-20 21:31:05]
  • 提交

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
...

output:


result: