Submission #74082692


Source Code Expand

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

const int N = 2e5 + 10, M = 2e6 + 10, mod = 998244353, INF = 0x3ffffffff, LOG = 23;
const long double PI = 3.141592653589793;

int n, m;
/*
int e[M], h[N], ne[M], idx;
inline void add(int u, int v){
    e[idx] = v, ne[idx] = h[u], h[u] = idx ++;
}
*/
int qpow(int x, int d){
    int res = 1;
    while(d){
        if(d & 1){
            res *= x;
        }
        x = (x * x) % mod;
        d >>= 1;
    }
    return res;
}

int __mod(int a){
    return ((a % mod) + mod) % mod;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    // memset(h, -1, sizeof h);
    cin >> n >> m;
    int q;
    cin >> q;
    int l = m, r = n;
    while(q --){
        int op;
        cin >> op;
        int rc;
        if(op == 1){
            cin >> rc;
            cout << rc * l << "\n";
            r -= rc;
        }else{
            cin >> rc;
            cout << rc * r << "\n";
            l -= rc;
        }
    }
    return 0;
}

Submission Info

Submission Time
Task B - Deconstruct Chocolate
User Queryme
Language C++23 (GCC 15.2.0)
Score 200
Code Size 1075 Byte
Status AC
Exec Time 1 ms
Memory 3688 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 1
AC × 21
Set Name Test Cases
Sample sample00.txt
All sample00.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt
Case Name Status Exec Time Memory
sample00.txt AC 1 ms 3424 KiB
testcase00.txt AC 1 ms 3528 KiB
testcase01.txt AC 1 ms 3528 KiB
testcase02.txt AC 1 ms 3608 KiB
testcase03.txt AC 1 ms 3464 KiB
testcase04.txt AC 1 ms 3428 KiB
testcase05.txt AC 1 ms 3492 KiB
testcase06.txt AC 1 ms 3424 KiB
testcase07.txt AC 1 ms 3512 KiB
testcase08.txt AC 1 ms 3428 KiB
testcase09.txt AC 1 ms 3632 KiB
testcase10.txt AC 1 ms 3492 KiB
testcase11.txt AC 1 ms 3528 KiB
testcase12.txt AC 1 ms 3424 KiB
testcase13.txt AC 1 ms 3476 KiB
testcase14.txt AC 1 ms 3556 KiB
testcase15.txt AC 1 ms 3556 KiB
testcase16.txt AC 1 ms 3688 KiB
testcase17.txt AC 1 ms 3552 KiB
testcase18.txt AC 1 ms 3492 KiB
testcase19.txt AC 1 ms 3548 KiB