Submission #65871163
Source Code Expand
#include <iostream> #include <stdio.h> #include <algorithm> #include <vector> #include <map> #include <set> #include <unordered_set> #include <unordered_map> using namespace std; #define pb push_back #define pii pair<int, int> const int maxN = 1e6; int n, m, q, r; set<int> stx[maxN]; set<int> sty[maxN]; int main() { cin >> n >> m >> r; for (int i =1 ; i <= r; i++) { int x, y; scanf("%d%d", &x, &y); stx[x].insert(y); sty[y].insert(x); } cin >> q; while(q--) { int tip, val; scanf("%d%d", &tip, &val); if (tip == 1) { printf("%d\n", (int)stx[val].size()); for (int i: stx[val]) { int y = i; int x = val; sty[i].erase(x); } stx[val].clear(); continue; } printf("%d\n", (int) sty[val].size()); for (int i: sty[val]) { int x = i; int y = val; stx[x].erase(y); } sty[val].clear(); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Garbage Removal |
User | allllekssssa |
Language | C++ 20 (gcc 12.2) |
Score | 400 |
Code Size | 949 Byte |
Status | AC |
Exec Time | 280 ms |
Memory | 116388 KiB |
Compile Error
Main.cpp: In function ‘int main()’: Main.cpp:42:37: warning: unused variable ‘y’ [-Wunused-variable] 42 | int y = i; | ^ Main.cpp:28:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 28 | scanf("%d%d", &x, &y); | ~~~~~^~~~~~~~~~~~~~~~ Main.cpp:37:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 37 | scanf("%d%d", &tip, &val); | ~~~~~^~~~~~~~~~~~~~~~~~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample00.txt, sample01.txt, sample02.txt |
All | sample00.txt, sample01.txt, sample02.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, testcase20.txt, testcase21.txt, testcase22.txt, testcase23.txt, testcase24.txt, testcase25.txt, testcase26.txt, testcase27.txt, testcase28.txt, testcase29.txt, testcase30.txt, testcase31.txt, testcase32.txt, testcase33.txt, testcase34.txt, testcase35.txt, testcase36.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample00.txt | AC | 40 ms | 97536 KiB |
sample01.txt | AC | 41 ms | 97564 KiB |
sample02.txt | AC | 40 ms | 97516 KiB |
testcase00.txt | AC | 96 ms | 100924 KiB |
testcase01.txt | AC | 191 ms | 116080 KiB |
testcase02.txt | AC | 71 ms | 104064 KiB |
testcase03.txt | AC | 207 ms | 116136 KiB |
testcase04.txt | AC | 161 ms | 112252 KiB |
testcase05.txt | AC | 203 ms | 116252 KiB |
testcase06.txt | AC | 145 ms | 113592 KiB |
testcase07.txt | AC | 210 ms | 116152 KiB |
testcase08.txt | AC | 207 ms | 116260 KiB |
testcase09.txt | AC | 223 ms | 114796 KiB |
testcase10.txt | AC | 280 ms | 116388 KiB |
testcase11.txt | AC | 224 ms | 113740 KiB |
testcase12.txt | AC | 269 ms | 116388 KiB |
testcase13.txt | AC | 132 ms | 111704 KiB |
testcase14.txt | AC | 181 ms | 116256 KiB |
testcase15.txt | AC | 117 ms | 110756 KiB |
testcase16.txt | AC | 191 ms | 116248 KiB |
testcase17.txt | AC | 102 ms | 108068 KiB |
testcase18.txt | AC | 193 ms | 116380 KiB |
testcase19.txt | AC | 79 ms | 102900 KiB |
testcase20.txt | AC | 199 ms | 116284 KiB |
testcase21.txt | AC | 131 ms | 108408 KiB |
testcase22.txt | AC | 216 ms | 116172 KiB |
testcase23.txt | AC | 159 ms | 115592 KiB |
testcase24.txt | AC | 207 ms | 116284 KiB |
testcase25.txt | AC | 213 ms | 115204 KiB |
testcase26.txt | AC | 262 ms | 116256 KiB |
testcase27.txt | AC | 151 ms | 108264 KiB |
testcase28.txt | AC | 273 ms | 116076 KiB |
testcase29.txt | AC | 91 ms | 102948 KiB |
testcase30.txt | AC | 251 ms | 116140 KiB |
testcase31.txt | AC | 145 ms | 106876 KiB |
testcase32.txt | AC | 257 ms | 116136 KiB |
testcase33.txt | AC | 93 ms | 104084 KiB |
testcase34.txt | AC | 225 ms | 116188 KiB |
testcase35.txt | AC | 87 ms | 99888 KiB |
testcase36.txt | AC | 222 ms | 116308 KiB |