Submission #3228751
Source Code Expand
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 100005;
pair<int,int> t[MAXN*9];
int tot,n,h,w;
inline bool bound(int x,int y)
{
return x>1 && x<h && y>1 && y<w;
}
int cnt[15];
int main()
{
scanf("%d%d%d",&h,&w,&n);
for(int i=1;i<=n;++i){
int a,b;
scanf("%d%d",&a,&b);
for(int j=-1;j<=1;++j)
for(int k=-1;k<=1;++k)
if(bound(a+j,b+k))t[++tot]=make_pair(a+j,b+k);
}
sort(t+1,t+tot+1);
int p=1,sum=0;
while(p<=tot){
int now=1;
while(t[p+1]==t[p])++p,++now;
++cnt[now];
++p;
++sum;
}
cout<<(long long)(h-2)*(w-2)-sum<<endl;
for(int i=1;i<=9;++i){
cout<<cnt[i]<<endl;
}
return 0;
}
Submission Info
Submission Time
2018-09-20 14:03:57+0900
Task
D - Snuke's Coloring
User
DFPMTS
Language
C++14 (GCC 5.4.1)
Score
400
Code Size
720 Byte
Status
AC
Exec Time
98 ms
Memory
7296 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:16:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d",&h,&w,&n);
^
./Main.cpp:19:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&a,&b);
^
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
83 ms
7168 KB
02.txt
AC
90 ms
7296 KB
03.txt
AC
22 ms
1920 KB
04.txt
AC
1 ms
256 KB
05.txt
AC
42 ms
4352 KB
06.txt
AC
40 ms
4352 KB
07.txt
AC
79 ms
7296 KB
08.txt
AC
81 ms
7296 KB
09.txt
AC
81 ms
7296 KB
10.txt
AC
1 ms
256 KB
11.txt
AC
92 ms
7296 KB
12.txt
AC
89 ms
7296 KB
13.txt
AC
1 ms
256 KB
14.txt
AC
97 ms
7296 KB
15.txt
AC
98 ms
7296 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