/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 528.0 KiB
#2 Accepted 2ms 540.0 KiB
#3 Accepted 2ms 332.0 KiB
#4 Accepted 2ms 540.0 KiB
#5 Accepted 2ms 540.0 KiB
#6 Accepted 2ms 540.0 KiB

Code

#include <bits/stdc++.h>
#define pb push_back
#define int long long
using namespace std;

const int mod = 998244353;
const int inf = 1e17;
const int N = 1e5+5;

int32_t main(){
    cin.tie(0); cout.tie(0);
    ios_base::sync_with_stdio(false);
    int n, m;
    cin>>n>>m;
    int ans = 0;
    for(int l = 1; l <= min(n, m); l++){
        ans += (n - l + 1) * (m - l + 1);
    }

    cout<<ans<<endl;
    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:56:39
Judged At
2024-11-11 02:32:02
Judged By
Score
100
Total Time
2ms
Peak Memory
540.0 KiB