Submission #4061964
Source Code Expand
#include <iostream> #include <algorithm> #include <string> #include <map> #include <queue> using namespace std; typedef long long ll; int main(){ map<pair<int,int>, int> mp; ll H,W,N; ll ANS[10]; cin>>H>>W>>N; ANS[0]=(H-2)*(W-2); for(int i = 1;i <= 9;i++){ ANS[i]=0; } ll a_,b_; for(int i = 0;i < N;i++){ cin>>a_>>b_; a_--;b_--; for(ll a = min(a_,H-3);a_-a < 3&&a>=0;a--){ for(ll b = min(b_,W-3);b_-b < 3&&b>=0;b--){ //cout<<a<<b<<endl; if(mp.count(make_pair(a,b))==0){ mp[make_pair(a,b)]=1; }else{ mp[make_pair(a,b)]++; } } } } map<pair<int,int>,int>::iterator it = mp.begin(); while(it!=mp.end()){ ANS[it->second]++; ANS[0]--; it++; } for(int i = 0;i <= 9;i++){ cout<<ANS[i]<<endl; } }
Submission Info
Submission Time | |
---|---|
Task | D - Snuke's Coloring |
User | taskooh |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 993 Byte |
Status | AC |
Exec Time | 578 ms |
Memory | 56448 KB |
Judge Result
Set Name | Sample | All | ||
---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||
Status | AC |
|
Set Name | Test Cases |
---|---|
Sample | |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, empty.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 273 ms | 6400 KB |
02.txt | AC | 478 ms | 41216 KB |
03.txt | AC | 67 ms | 3328 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 189 ms | 18944 KB |
06.txt | AC | 198 ms | 18944 KB |
07.txt | AC | 474 ms | 56448 KB |
08.txt | AC | 490 ms | 56448 KB |
09.txt | AC | 494 ms | 56448 KB |
10.txt | AC | 1 ms | 256 KB |
11.txt | AC | 481 ms | 38528 KB |
12.txt | AC | 530 ms | 56320 KB |
13.txt | AC | 2 ms | 256 KB |
14.txt | AC | 578 ms | 46592 KB |
15.txt | AC | 513 ms | 38656 KB |
empty.txt | AC | 1 ms | 256 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |