/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 328.0 KiB
#3 Accepted 1ms 532.0 KiB
#4 Accepted 1ms 396.0 KiB
#5 Accepted 1ms 328.0 KiB
#6 Accepted 1ms 532.0 KiB

Code

#ifndef LOCAL
#include <bits/stdc++.h>
#define debug(...)
#endif

using namespace std;
#define int long long
#define cinv(v) for (auto &it:v) cin>>it;
#define coutv(v) for (auto &it:v) cout<< it<<' '; cout<<'\n';

void shelby() {
    int n, m;
    cin >> n >> m;
    int ans = 0;
    for (int i = 1; i <= min(n, m); ++i) {
        ans += (n - i + 1) * (m - i + 1);
        debug(ans);
    }
    cout << ans << '\n';
}

signed main() {
    cin.tie(0)->sync_with_stdio(0);
    int t = 1;
    // cin >> t;
    for (int _ = 1; _ <= t; ++_) {
        // cout << "Case " << _ << ": ";
        shelby();
    }
}

Information

Submit By
Type
Submission
Problem
P1121 Square Counting Challenge
Contest
Brain Booster #7
Language
C++17 (G++ 13.2.0)
Submit At
2024-11-05 14:33:02
Judged At
2024-11-11 02:33:14
Judged By
Score
100
Total Time
1ms
Peak Memory
532.0 KiB