Code
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
ll row,col;
cin>>row>>col;
ll ans=row*col;
for(ll i=2;i<=min(row,col);i++)
{
ans+=(1+(row-i))*(1+col-i);
}
cout<<ans<<endl;
}
Information
- Submit By
- Type
- Pretest
- Problem
- P1121 Square Counting Challenge
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-11-05 14:46:41
- Judged At
- 2024-11-11 02:32:33
- Judged By
- Score
- 10
- Total Time
- 1ms
- Peak Memory
- 328.0 KiB