Accepted
Code
#include<bits/stdc++.h>
using namespace std;
const long long M=2e5+10,MOD=998244353;
typedef long long ll;
#define debug(x) cout<<x<<endl
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int t=1;
// cin>>t;
while(t--){
int h,w;
cin>>h>>w;
ll ans=0;
for(int i=1;i<=min(h,w);i++){
ll x=h-i+1;
ll y=w-i+1;
ans+=(x*y);
}
cout<<ans<<"\n";
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1121 Square Counting Challenge
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-11-07 18:48:24
- Judged At
- 2024-11-11 02:23:05
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 436.0 KiB