/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 532.0 KiB
#2 Wrong Answer 1ms 532.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define ull unsigned long long
#define vecint vector<int>
#define vecchar vector<char>
#define un_set unordered_set
#define un_map unordered_map
#define max_ele(v) *max_element(v.begin(), v.end())
#define min_ele(v) *min_element(v.begin(), v.end())
#define sort_asc(v) sort(v.begin(), v.end())
#define sort_dec(v) sort((v).begin(), (v).end(), greater<>())
#define Reverse(v) reverse(v.begin(), v.end())
#define pb push_back
#define ppb pop_back()
#define pf push_front
#define coutall(v)     \
    for (auto &it : v) \
    cout << it << " "
#define coutnewline(v) \
    for (auto &it : v) \
    cout << it << '\n'
#define cinall(v)      \
    for (auto &it : v) \
    cin >> it
#define yes cout << "YES\n"
#define no cout << "NO\n"

void solucionar()
{
    int h, w;
    cin >> h >> w;
    int count=0;
    for (int i = 1; i < h; i++)
    {
        for (int j = 1; j < w; j++)
        {
            count++;
        }
    }
    for (int i = 1; i < h-1; i++)
    {
        for (int j = 1; j < w-1; j++)
        {
            count++;
        }
    }
    cout << count+(h*w) <<endl;
}

int main()
{
    int tests;
    cin >> tests;
    while (tests-- > 0)
    {
        solucionar();
    }
    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 15:04:30
Judged At
2024-11-05 15:04:30
Judged By
Score
0
Total Time
1ms
Peak Memory
532.0 KiB