Submission #1688576
Source Code Expand
#include<bits/stdc++.h> using namespace std; #define REP(i,s,n) for(int i=s;i<n;++i) #define rep(i,n) REP(i,0,n) #define SORT(c) sort((c).begin(),(c).end()) #define IINF INT_MAX #define LLINF LLONG_MAX typedef long long ll; typedef pair<int, int> ii; int main(){ ll h, w, n; cin >> h >> w >> n; vector<ll> a(n), b(n); rep(i, n){ cin >> a[i] >> b[i]; a[i]--; b[i]--; } if(h*w <= 100000LL){ vector<vector<int>> cnt(h, vector<int>(w, 0)); rep(i, n){ for(int j = -1; j <= 1; j++){ for(int k = -1; k <= 1; k++){ ll na = a[i] + j; ll nb = b[i] + k; if(na < 0 || h <= na || nb < 0 || w <= nb) continue; cnt[na][nb]++; } } } vector<ll> ans(10, 0); REP(i, 1, h-1) REP(j, 1, w-1) ans[cnt[i][j]]++; rep(i, 10) cout << ans[i] << endl; } else{ assert(false); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Snuke's Coloring |
User | letter |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 941 Byte |
Status | RE |
Exec Time | 177 ms |
Memory | 2304 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 43 ms | 2304 KB |
02.txt | RE | 140 ms | 1792 KB |
03.txt | AC | 12 ms | 896 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | RE | 152 ms | 1792 KB |
06.txt | RE | 154 ms | 1792 KB |
07.txt | RE | 162 ms | 1792 KB |
08.txt | RE | 177 ms | 1792 KB |
09.txt | RE | 175 ms | 1792 KB |
10.txt | RE | 97 ms | 256 KB |
11.txt | RE | 153 ms | 1792 KB |
12.txt | RE | 158 ms | 1792 KB |
13.txt | RE | 98 ms | 256 KB |
14.txt | RE | 175 ms | 1792 KB |
15.txt | RE | 176 ms | 1792 KB |
empty.txt | RE | 98 ms | 256 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | RE | 98 ms | 256 KB |