QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#114714#5038. Cityhos_lyricAC ✓1ms3860kbC++141.5kb2023-06-23 07:41:262023-06-23 07:41:27

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-23 07:41:27]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3860kb
  • [2023-06-23 07:41:26]
  • 提交

answer

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }



int main() {
  Int M, N;
  for (; ~scanf("%lld%lld", &N, &M); ) {
    Int ans = 0;
    for (Int s = 0; s < 2; ++s) for (Int t = 0; t < 2; ++t) {
      const Int m = (M+1 + s) / 2;
      const Int n = (N+1 + t) / 2;
      const Int a = m * n;
      ans += a * (a - 1) / 2;
    }
    printf("%lld\n", ans);
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3720kb

input:

1 1

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: 0
Accepted
time: 1ms
memory: 3672kb

input:

2 3

output:

14

result:

ok 1 number(s): "14"

Test #3:

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

input:

252 139

output:

156806790

result:

ok 1 number(s): "156806790"

Test #4:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

96 859

output:

869912790

result:

ok 1 number(s): "869912790"

Test #5:

score: 0
Accepted
time: 1ms
memory: 3844kb

input:

237 987

output:

6911470020

result:

ok 1 number(s): "6911470020"

Test #6:

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

input:

81 411

output:

142652940

result:

ok 1 number(s): "142652940"

Test #7:

score: 0
Accepted
time: 1ms
memory: 3628kb

input:

221 539

output:

1796341860

result:

ok 1 number(s): "1796341860"

Test #8:

score: 0
Accepted
time: 1ms
memory: 3860kb

input:

770 259

output:

5022934670

result:

ok 1 number(s): "5022934670"

Test #9:

score: 0
Accepted
time: 1ms
memory: 3676kb

input:

422 387

output:

3367022678

result:

ok 1 number(s): "3367022678"

Test #10:

score: 0
Accepted
time: 1ms
memory: 3852kb

input:

563 515

output:

10586725560

result:

ok 1 number(s): "10586725560"

Test #11:

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

input:

407 939

output:

18385757040

result:

ok 1 number(s): "18385757040"

Test #12:

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

input:

518 518

output:

9069351200

result:

ok 1 number(s): "9069351200"

Test #13:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

171 646

output:

1547964138

result:

ok 1 number(s): "1547964138"

Test #14:

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

input:

311 70

output:

61339980

result:

ok 1 number(s): "61339980"

Test #15:

score: 0
Accepted
time: 1ms
memory: 3668kb

input:

155 494

output:

745330482

result:

ok 1 number(s): "745330482"

Test #16:

score: 0
Accepted
time: 1ms
memory: 3668kb

input:

704 918

output:

52470835129

result:

ok 1 number(s): "52470835129"

Test #17:

score: 0
Accepted
time: 1ms
memory: 3628kb

input:

844 46

output:

197229825

result:

ok 1 number(s): "197229825"

Test #18:

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

input:

688 174

output:

1817294209

result:

ok 1 number(s): "1817294209"

Test #19:

score: 0
Accepted
time: 1ms
memory: 3860kb

input:

637 894

output:

40756317888

result:

ok 1 number(s): "40756317888"

Test #20:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

481 22

output:

15385922

result:

ok 1 number(s): "15385922"

Test #21:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

1 2

output:

2

result:

ok 1 number(s): "2"

Test #22:

score: 0
Accepted
time: 1ms
memory: 3716kb

input:

1 1000

output:

500000

result:

ok 1 number(s): "500000"

Test #23:

score: 0
Accepted
time: 1ms
memory: 3628kb

input:

1000 1000

output:

125500500000

result:

ok 1 number(s): "125500500000"

Test #24:

score: 0
Accepted
time: 1ms
memory: 3672kb

input:

999 1000

output:

125249749500

result:

ok 1 number(s): "125249749500"

Test #25:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

1000 999

output:

125249749500

result:

ok 1 number(s): "125249749500"

Test #26:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

999 999

output:

124999500000

result:

ok 1 number(s): "124999500000"

Test #27:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

998 999

output:

124749750500

result:

ok 1 number(s): "124749750500"

Test #28:

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

input:

2 1

output:

2

result:

ok 1 number(s): "2"

Test #29:

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

input:

2 2

output:

8

result:

ok 1 number(s): "8"

Test #30:

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

input:

2 1000

output:

1251001

result:

ok 1 number(s): "1251001"