Submission #1530539
Source Code Expand
#include <vector> #include <queue> #include <algorithm> #include <iostream> #include <string> #include <ctime> #include <map> #include <stack> #include <sstream> using namespace std; int main(void) { map <pair<int,int>,int> painted; long long int count[10] = { 0, }; int H, W, N; int a, b; cin >> H >> W >> N; for (int i = 0; i < N; i++) { cin >> a >> b; painted[make_pair(a,b)] = 1; } for (int i = 1; i <= H - 2; i++) { for (int j = 1; j <= W - 2; j++) { int temp = 0; for (int x = i; x <= i + 2; x++) { for (int y = j; y <= j + 2; y++) { if (painted[make_pair(x,y)] == 1) { temp+=1; } } } count[temp] += 1; } } for (int i = 0; i < 10; i++) { cout << count[i] << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Snuke's Coloring |
User | joker_x |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 813 Byte |
Status | TLE |
Exec Time | 3175 ms |
Memory | 246272 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 | 130 ms | 6528 KB |
02.txt | AC | 1100 ms | 77440 KB |
03.txt | AC | 48 ms | 3328 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | TLE | 3175 ms | 246272 KB |
06.txt | TLE | 3173 ms | 218112 KB |
07.txt | TLE | 3163 ms | 78080 KB |
08.txt | TLE | 3169 ms | 164096 KB |
09.txt | TLE | 3169 ms | 162944 KB |
10.txt | TLE | 3169 ms | 151296 KB |
11.txt | TLE | 3165 ms | 100096 KB |
12.txt | TLE | 3169 ms | 166272 KB |
13.txt | TLE | 3168 ms | 153600 KB |
14.txt | TLE | 3168 ms | 155520 KB |
15.txt | TLE | 3169 ms | 162176 KB |
empty.txt | TLE | 3171 ms | 170240 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | TLE | 3169 ms | 171008 KB |