QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#195194#2383. Broken Watchgalen_colin#AC ✓0ms3820kbC++141.0kb2023-10-01 02:01:482023-10-01 02:01:48

Judging History

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

  • [2023-10-01 02:01:48]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3820kb
  • [2023-10-01 02:01:48]
  • 提交

answer

// comp = compile
// compr = compile & run
// in terminal, gocp goes to cp directory

#include <bits/stdc++.h>
using namespace std;

#include <bits/extc++.h>
using namespace __gnu_pbds;
using ll = long long;

using ordered_set = tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update>;
using pl = pair<ll, ll>;
#define f first
#define s second

using ul = unsigned long long;

ul n, q;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    ul a, b, c;
    cin >> a >> b >> c >> n;

    ul ans = 0;

    vector<ul> v = {n, n - 1, n - 2};
    for (int i = 2; i <= 3; i++) {
        for (ul &x: v) if (x % i == 0) {
            x /= i;
            break;
        }
    }

    ans = v[0] * v[1] * v[2];

    ul t = (n - 1) / 2;
    ans -= n * (t * (t - 1) / 2);

    ul f = 6;
    map<ll, ll> ct;
    ++ct[a];
    ++ct[b];
    ++ct[c];
    for (auto x: ct) {
        ll c = x.s;
        for (ll i = 2; i <= c; i++) f /= i;
    }

    cout << ans * f << '\n';
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3588kb

input:

1193 2741 3559 2

output:

0

result:

ok single line: '0'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

1193 2741 3559 17

output:

1224

result:

ok single line: '1224'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

1193 2741 2741 17

output:

612

result:

ok single line: '612'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

2741 2741 2741 17

output:

204

result:

ok single line: '204'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

1193 2741 3559 1193

output:

424483716

result:

ok single line: '424483716'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3480kb

input:

1193 2741 2741 1193

output:

212241858

result:

ok single line: '212241858'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

2741 2741 2741 1193

output:

70747286

result:

ok single line: '70747286'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

1193 2741 3559 2000000000

output:

10584946410820579328

result:

ok single line: '10584946410820579328'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

1193 2741 2741 2000000000

output:

14515845242265065472

result:

ok single line: '14515845242265065472'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

2741 2741 2741 2000000000

output:

4838615080755021824

result:

ok single line: '4838615080755021824'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

1193 2741 3559 2000000001

output:

7584946419820579328

result:

ok single line: '7584946419820579328'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

1193 2741 2741 2

output:

0

result:

ok single line: '0'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

1193 2741 2741 2000000001

output:

13015845246765065472

result:

ok single line: '13015845246765065472'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

2741 2741 2741 2000000001

output:

4338615082255021824

result:

ok single line: '4338615082255021824'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

1193 2741 3559 4000000000

output:

5339339113435979776

result:

ok single line: '5339339113435979776'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

1193 2741 2741 4000000000

output:

11893041593572765696

result:

ok single line: '11893041593572765696'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

2741 2741 2741 4000000000

output:

16262176580330622976

result:

ok single line: '16262176580330622976'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

1193 2741 3559 4000000001

output:

11786083205145531392

result:

ok single line: '11786083205145531392'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

1193 2741 2741 4000000001

output:

5893041602572765696

result:

ok single line: '5893041602572765696'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

2741 2741 2741 4000000001

output:

14262176583330622976

result:

ok single line: '14262176583330622976'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

1193 2741 3559 4294967295

output:

4611686020574871552

result:

ok single line: '4611686020574871552'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3696kb

input:

1193 2741 2741 4294967295

output:

11529215047142211584

result:

ok single line: '11529215047142211584'

Test #23:

score: 0
Accepted
time: 0ms
memory: 3460kb

input:

2741 2741 2741 2

output:

0

result:

ok single line: '0'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

2741 2741 2741 4294967295

output:

9991986373617254400

result:

ok single line: '9991986373617254400'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

1193 2741 3559 4294967294

output:

18446744043644780556

result:

ok single line: '18446744043644780556'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

1193 2741 2741 4294967294

output:

18446744058677166086

result:

ok single line: '18446744058677166086'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

2741 2741 2741 4294967294

output:

12297829377462239234

result:

ok single line: '12297829377462239234'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

1193 2741 3559 3

output:

6

result:

ok single line: '6'

Test #29:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

1193 2741 2741 3

output:

3

result:

ok single line: '3'

Test #30:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

2741 2741 2741 3

output:

1

result:

ok single line: '1'

Test #31:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

1193 2741 3559 4

output:

24

result:

ok single line: '24'

Test #32:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

1193 2741 2741 4

output:

12

result:

ok single line: '12'

Test #33:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

2741 2741 2741 4

output:

4

result:

ok single line: '4'