QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#723963#5678. Busy As a BeeBackToSquare1AC ✓1ms3712kbC++201.5kb2024-11-08 05:04:282024-11-08 05:04:29

Judging History

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

  • [2024-11-08 05:04:29]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3712kb
  • [2024-11-08 05:04:28]
  • 提交

answer

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
// using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
 
typedef pair<ll, ll> pl;
typedef pair<ld,ld> pd;
typedef vector<ll> vl;
// typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
 
 
#define G(x) ll x; cin >> x;
#define F(i, l, r) for (ll i = l; i < (r); ++i)
#define all(a) begin(a), end(a)
#define K first
#define V second
#define OK(i,j) i >= 0 && i < n && j >= 0 && j < m
 
#define NN 2505
#define MM 5005
#define MOD 1000007

bool comp_three(string a, string b, string c) {
    bool ok = 1;
    for(ll i=0;i<4;i++) {
        if(a[i] == b[i] && a[i] == c[i]) continue;
        if(a[i] != b[i] && a[i] != c[i] && b[i] != c[i]) continue;
        ok = 0;
    }
    return ok;
}

void solve() {

    ll M, N;
    cin >> M >> N;

    ll numTop = M;
    ll numBottom = (N%2 == 0 ? M-1 : M);

    ll numEdgesTop = 2*numTop;
    ll numEdgesBottom = 2*numBottom;
    ll numEdgesSide = 2*(N+N-1);
    ll numHexagons = M*((N+1)/2) + (M-1)*(N/2);
    ll numEdges = (6*numHexagons + numEdgesTop + numEdgesBottom + numEdgesSide)/2;

    if(numHexagons%2 == 0) cout << numEdges - numHexagons/2 + 1 << '\n';
    else cout << numEdges - (numHexagons+1)/2 + 1 << '\n';

}

int main() {
    cin.tie(0)->sync_with_stdio(0);
    cout << fixed << setprecision(10);

    solve();

    return 0;

}

详细

Test #1:

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

input:

2 1

output:

11

result:

ok single line: '11'

Test #2:

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

input:

3 3

output:

32

result:

ok single line: '32'

Test #3:

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

input:

2 2

output:

14

result:

ok single line: '14'

Test #4:

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

input:

1000000 1000000

output:

2500002749999

result:

ok single line: '2500002749999'

Test #5:

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

input:

2 1000000

output:

5750003

result:

ok single line: '5750003'

Test #6:

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

input:

1000000 1

output:

4500002

result:

ok single line: '4500002'

Test #7:

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

input:

64 64

output:

10415

result:

ok single line: '10415'

Test #8:

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

input:

2 64

output:

371

result:

ok single line: '371'

Test #9:

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

input:

64 2

output:

448

result:

ok single line: '448'

Test #10:

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

input:

3 3

output:

32

result:

ok single line: '32'

Test #11:

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

input:

100 50

output:

12736

result:

ok single line: '12736'

Test #12:

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

input:

50000 25000

output:

3125118749

result:

ok single line: '3125118749'

Test #13:

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

input:

25000 50000

output:

3125087499

result:

ok single line: '3125087499'

Test #14:

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

input:

2017 2023

output:

10206530

result:

ok single line: '10206530'

Test #15:

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

input:

2 2023

output:

11637

result:

ok single line: '11637'

Test #16:

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

input:

2023 1

output:

9105

result:

ok single line: '9105'

Test #17:

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

input:

2023 101

output:

514930

result:

ok single line: '514930'

Test #18:

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

input:

12348 5554

output:

171480840

result:

ok single line: '171480840'