编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#49246 #1250. 丁丁打工记 Accepted 100 836 ms 480 K C++ 17 / 1.4 K 丁丁跑卡车 2021-06-06 16:41:22
显示原始代码
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define ud unsigned int
#define ll long long
#define ull unsigned long long
#define MAX_INF 0x3f
#define MAX_INF_VAL 0x3f3f3f3f
#define MAX_INF_VAL_LL 0x3f3f3f3f3f3f3f3f
//#define pi 3.141592653589
#define eps 1e-9
#define F(x) ((x) / 3 + ((x) % 3 == 1 ? 0 : tb))
#define G(x) ((x) < tb ? (x)*3 + 1 : ((x)-tb) * 3 + 2)
//#define p 2173412051LL
//#define sz 2

using namespace std;

template <typename T>
void read(T &x) {
    x = 0;
    char ch = getchar();
    ll f = 1;
    while (!isdigit(ch)) {
        if (ch == '-')
            f *= -1;
        ch = getchar();
    }
    while (isdigit(ch)) {
        x = x * 10 + ch - 48;
        ch = getchar();
    }
    x *= f;
}

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int t;
    ll a, b, m;
    cin >> t;
    while (t--) {
        cin >> a >> b >> m;
        ll p = b * m + a, q = b - a;
        ll g = __gcd(p, q);
        cout << p / g << ' ' << q / g << '\n';
    }
    return 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:84 ms
内存:468 KiB

输入文件(1.in

100000
9564096 94964498 224708554
563342758 872159648 324757907
237659263 908407936 216204877
73
<3030242 bytes omitted>

答案文件(1.out

10669667518239994 42700201
141620371208839747 154408445
196402226306363135 670748673
181011300816
<2827807 bytes omitted>

用户输出

10669667518239994 42700201
141620371208839747 154408445
196402226306363135 670748673
181011300816574739 66890489
182119200126823
<2727779 bytes omitted>

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:83 ms
内存:472 KiB

输入文件(2.in

100000
9295568 73268948 603217067
619153048 632065398 153760839
496859230 532878281 669297545
55
<3029824 bytes omitted>

答案文件(2.out

3683089993669257 5331115
9718690651850197 1291235
356654125753979375 36019051
16070751432644619 1
<2828105 bytes omitted>

用户输出

3683089993669257 5331115
9718690651850197 1291235
356654125753979375 36019051
16070751432644619 145351
178044185214643366 120119
<2728077 bytes omitted>

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:83 ms
内存:372 KiB

输入文件(3.in

100000
397497090 725301231 705734994
115597120 175332226 6414838
27259681 380128023 492020249
12
<3030406 bytes omitted>

答案文件(3.out

24374783824070224 15609721
562363970783254 29867553
93515342277798704 176434171
4712084984141971 
<2828301 bytes omitted>

用户输出

24374783824070224 15609721
562363970783254 29867553
93515342277798704 176434171
4712084984141971 8273247
79962089418525709 84458
<2728273 bytes omitted>

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:90 ms
内存:396 KiB

输入文件(4.in

100000
5086692 420791480 708157858
505532448 596536842 449933499
23568002 31732734 278656976
200
<3030352 bytes omitted>

答案文件(4.out

74496698286634133 103926197
44733651518167101 15167399
4421273860110193 4082366
72819770766548817
<2828439 bytes omitted>

用户输出

74496698286634133 103926197
44733651518167101 15167399
4421273860110193 4082366
72819770766548817 9759583
69703693591992397 3121
<2728411 bytes omitted>

系统信息

Exited with return code 0
测试点 #5
Accepted
得分:100
用时:83 ms
内存:480 KiB

输入文件(5.in

100000
125686994 146990527 210028052
19738430 21239383 915280329
114967544 833166292 97196976
22
<3030251 bytes omitted>

答案文件(5.out

30872134173950398 21303533
19439989479735437 1500953
20245311050625134 179549687
1376393228072015
<2827665 bytes omitted>

用户输出

30872134173950398 21303533
19439989479735437 1500953
20245311050625134 179549687
137639322807201559 249977306
33386558670888776 
<2727637 bytes omitted>

系统信息

Exited with return code 0
测试点 #6
Accepted
得分:100
用时:82 ms
内存:404 KiB

输入文件(6.in

100000
214231311 960042853 463178458
145707337 839340444 322067724
26924007 48071188 160136086
3
<3030301 bytes omitted>

答案文件(6.out

63524452640098855 106544506
270324466605936793 693633107
699811992964925 1922471
1522072599803453
<2827500 bytes omitted>

用户输出

63524452640098855 106544506
270324466605936793 693633107
699811992964925 1922471
1522072599803453 418557
409525781382326741 1313
<2727472 bytes omitted>

系统信息

Exited with return code 0
测试点 #7
Accepted
得分:100
用时:83 ms
内存:420 KiB

输入文件(7.in

100000
299805728 802554743 50199896
191103003 330915770 984159835
237203346 400499657 339028585

<3030325 bytes omitted>

答案文件(7.out

13429388310904152 167583005
325674009793200953 139812767
135780832242898691 163296311
36073676527
<2828899 bytes omitted>

用户输出

13429388310904152 167583005
325674009793200953 139812767
135780832242898691 163296311
36073676527622174 53176201
205962241250691
<2728871 bytes omitted>

系统信息

Exited with return code 0
测试点 #8
Accepted
得分:100
用时:82 ms
内存:420 KiB

输入文件(8.in

100000
904615668 957945536 133120261
4895917 166781149 858900047
42858480 238629614 778185373
16
<3030473 bytes omitted>

答案文件(8.out

31880490170180141 13332467
2984340348327290 3372609
92849037611147251 97885567
4225329559526567 4
<2827336 bytes omitted>

用户输出

31880490170180141 13332467
2984340348327290 3372609
92849037611147251 97885567
4225329559526567 4977684
122041106160356657 21930
<2727308 bytes omitted>

系统信息

Exited with return code 0
测试点 #9
Accepted
得分:100
用时:82 ms
内存:404 KiB

输入文件(9.in

100000
62113672 104646013 121234793
448882160 603146330 256662632
30202183 533505496 194292464
7
<3030303 bytes omitted>

答案文件(9.out

4228912595481327 14177447
5160170832927424 5142139
34552032468528109 167767771
9152203658968538 2
<2827886 bytes omitted>

用户输出

4228912595481327 14177447
5160170832927424 5142139
34552032468528109 167767771
9152203658968538 22418737
1167196176854317 633252
<2727858 bytes omitted>

系统信息

Exited with return code 0
测试点 #10
Accepted
得分:100
用时:84 ms
内存:420 KiB

输入文件(10.in

100000
95099898 322498358 772907256
254404001 657630422 772668356
502498937 744523970 461976654

<3030790 bytes omitted>

答案文件(10.out

124630660520692773 113699230
169376739092243411 134408807
343952692985895317 242025033
3185542670
<2828482 bytes omitted>

用户输出

124630660520692773 113699230
169376739092243411 134408807
343952692985895317 242025033
318554267017969915 30097637
2922608752281
<2728454 bytes omitted>

系统信息

Exited with return code 0