/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 436.0 KiB
#2 Accepted 1ms 320.0 KiB
#3 Accepted 1ms 320.0 KiB
#4 Accepted 1ms 324.0 KiB
#5 Accepted 1ms 324.0 KiB
#6 Accepted 1ms 324.0 KiB

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