Submission #74107192
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
struct Init { Init() { ios::sync_with_stdio(0); cin.tie(0); cout << setprecision(13); } }init;
using ll = long long;
using pll = pair<ll, ll>;
const int inf = 1073741823;
const long long INF = 1LL << 60;
#define el '\n'
#define spa " "
#define pb emplace_back
#define rep(i, s, n) for(int i = (s); i < (int)(n); i++)
#define rrep(i, s, n) for(int i = (int)(n) - 1; i >= (s); i--)
#define Yes cout << "Yes" << el
#define No cout << "No" << el
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define unless(c) if(!(c))
#define until(c) while(!(c))
int sub(){
return 0;
}
int solve() {
int h, w, q;
cin >> h >> w >> q;
vector<vector<bool>> c(h,vector<bool>(w, true));
while(q--){
int que;
cin >> que;
int cnt = 0;
if(que == 1){
int n;
cin >> n;
rep(i, h-n, h){
rep(j, 0, w){
if(c[i][j]){
cnt++;
}
c[i][j] = false;
}
}
h -= n;
cout << cnt << el;
}
if(que == 2){
int n;
cin >> n;
rep(i, w-n, w){
rep(j, 0, h){
if(c[j][i])cnt++;
c[j][i] = false;
}
}
w -= n;
cout << cnt << el;
}
}
return 0;
}
int main() {
int t = 1;
// cin >> t;
rep(i, 0, t) {
solve();
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Deconstruct Chocolate |
| User | tuttutu256 |
| Language | C++23 (GCC 15.2.0) |
| Score | 200 |
| Code Size | 1646 Byte |
| Status | AC |
| Exec Time | 2 ms |
| Memory | 3648 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| 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 | 2 ms | 3636 KiB |
| testcase00.txt | AC | 1 ms | 3648 KiB |
| testcase01.txt | AC | 1 ms | 3596 KiB |
| testcase02.txt | AC | 1 ms | 3596 KiB |
| testcase03.txt | AC | 1 ms | 3644 KiB |
| testcase04.txt | AC | 1 ms | 3512 KiB |
| testcase05.txt | AC | 1 ms | 3592 KiB |
| testcase06.txt | AC | 1 ms | 3644 KiB |
| testcase07.txt | AC | 1 ms | 3460 KiB |
| testcase08.txt | AC | 1 ms | 3600 KiB |
| testcase09.txt | AC | 1 ms | 3592 KiB |
| testcase10.txt | AC | 1 ms | 3420 KiB |
| testcase11.txt | AC | 1 ms | 3592 KiB |
| testcase12.txt | AC | 1 ms | 3600 KiB |
| testcase13.txt | AC | 1 ms | 3576 KiB |
| testcase14.txt | AC | 1 ms | 3632 KiB |
| testcase15.txt | AC | 1 ms | 3576 KiB |
| testcase16.txt | AC | 1 ms | 3548 KiB |
| testcase17.txt | AC | 1 ms | 3592 KiB |
| testcase18.txt | AC | 1 ms | 3468 KiB |
| testcase19.txt | AC | 1 ms | 3648 KiB |