Accepted
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