/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 1ms 356.0 KiB
#4 Accepted 1ms 532.0 KiB
#5 Accepted 1ms 320.0 KiB
#6 Accepted 1ms 516.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long int
#define N (ll)1e6
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t=1,i=1,j,p,mx,tot,n,a,m,x,y,k,rt,c,b=1;
    //cin>>t;
    while(t--){
        cin>>x>>y;
        if(x>y)
            swap(x,y);
        ll sm=0;
        for(a=0;a<x;a++)
            sm=sm+(x-a)*(y-a);
        cout<<sm<<endl;
    }
}

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:37:05
Judged At
2024-11-11 02:33:01
Judged By
Score
100
Total Time
1ms
Peak Memory
532.0 KiB