Submission #4639781
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<ll,ll> P;
#define pb push_back
#define mp make_pair
#define fr(i,n) for(int i=0;i<n;i++)
#define Fr(i,n) for(int i=0;i++<n;)
#define ifr(i,n) for(int i=n-1;i>=0;i--)
#define iFr(i,n) for(int i=n;i>0;i--)
#define srd(i,x) for(int i=x-1;i<=x+1;i++)
int main(){
ll h,w,n,a[100010],b[100010],c,ans[10]={};
map<P,bool> m,vis;
cin>>h>>w>>n;
fr(i,n){
cin>>a[i]>>b[i];
m[mp(--a[i],--b[i])]=1;
}
fr(k,n){
srd(i,a[k]){srd(j,b[k]){if(0<i&&i<h-1&&0<j&&j<w-1){
if(!vis[mp(i,j)]){
vis[mp(i,j)]=1;
c=0;
srd(I,i) srd(J,j) c+=m[mp(I,J)];
ans[c]++;
}
}}}
}
ans[0]=(h-2)*(w-2);
Fr(i,9) ans[0]-=ans[i];
fr(i,10) cout<<ans[i]<<endl;
}
Submission Info
Submission Time |
|
Task |
D - Snuke's Coloring |
User |
Motsu_xe |
Language |
C++14 (GCC 5.4.1) |
Score |
400 |
Code Size |
827 Byte |
Status |
AC |
Exec Time |
2012 ms |
Memory |
214272 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 |
335 ms |
14208 KB |
02.txt |
AC |
1519 ms |
110464 KB |
03.txt |
AC |
111 ms |
6784 KB |
04.txt |
AC |
1 ms |
256 KB |
05.txt |
AC |
999 ms |
114304 KB |
06.txt |
AC |
816 ms |
114304 KB |
07.txt |
AC |
1637 ms |
214144 KB |
08.txt |
AC |
1606 ms |
214272 KB |
09.txt |
AC |
1613 ms |
214272 KB |
10.txt |
AC |
1 ms |
256 KB |
11.txt |
AC |
1388 ms |
98304 KB |
12.txt |
AC |
2012 ms |
212224 KB |
13.txt |
AC |
2 ms |
384 KB |
14.txt |
AC |
1741 ms |
139136 KB |
15.txt |
AC |
1358 ms |
98432 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 |