/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 540.0 KiB
#2 Wrong Answer 2ms 540.0 KiB

Code

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

#define MOD 1000000007
#define ll long long
#define INF LLONG_MIN




void solve() {
    int H, W;
    cin >> H >> W;

    int mn = min(H, W);
    ll ans = 0;
    for (int k = 1; k <= mn; k++) {
        ll x = (H - k + 1) * (W - k + 1);
        ans += x;
    }

    cout << ans << endl;
    
    
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    solve();
    return 0;
}

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:34:17
Judged At
2024-11-11 02:33:09
Judged By
Score
0
Total Time
2ms
Peak Memory
540.0 KiB