Submission #20014037


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,i,j,h,w,cur,ans;
	cin >> h >> w;
	vector<string> s(h);
	for(i=0; i<h; i++){
		cin >> s[i];
	}
	
	ans=0;
	for(i=0; i<h-1; i++){
		for(j=0; j<w-1; j++){
			cur=0;
			if(s[i][j]=='#') cur++;
			if(s[i+1][j]=='#') cur++;
			if(s[i][j+1]=='#') cur++;
			if(s[i+1][j+1]=='#') cur++;
			if(cur==1 || cur==3){
				ans++;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Submission Info

Submission Time
Task C - Digital Graffiti
User hocashi
Language C++ (GCC 9.2.1)
Score 300
Code Size 452 Byte
Status AC
Exec Time 8 ms
Memory 3568 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:5:6: warning: unused variable ‘n’ [-Wunused-variable]
    5 |  int n,i,j,h,w,cur,ans;
      |      ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 1
AC × 27
Set Name Test Cases
Sample sample_01.txt
All handmade_00.txt, handmade_01.txt, handmade_02.txt, handmade_03.txt, oldsample_00.txt, oldsample_01.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, sample_01.txt
Case Name Status Exec Time Memory
handmade_00.txt AC 8 ms 3324 KiB
handmade_01.txt AC 2 ms 3568 KiB
handmade_02.txt AC 2 ms 3512 KiB
handmade_03.txt AC 2 ms 3508 KiB
oldsample_00.txt AC 2 ms 3560 KiB
oldsample_01.txt AC 2 ms 3508 KiB
random_00.txt AC 2 ms 3568 KiB
random_01.txt AC 2 ms 3404 KiB
random_02.txt AC 2 ms 3560 KiB
random_03.txt AC 2 ms 3560 KiB
random_04.txt AC 2 ms 3568 KiB
random_05.txt AC 2 ms 3400 KiB
random_06.txt AC 2 ms 3556 KiB
random_07.txt AC 3 ms 3416 KiB
random_08.txt AC 2 ms 3568 KiB
random_09.txt AC 2 ms 3568 KiB
random_10.txt AC 3 ms 3420 KiB
random_11.txt AC 2 ms 3568 KiB
random_12.txt AC 3 ms 3328 KiB
random_13.txt AC 3 ms 3404 KiB
random_14.txt AC 3 ms 3380 KiB
random_15.txt AC 2 ms 3420 KiB
random_16.txt AC 2 ms 3420 KiB
random_17.txt AC 2 ms 3512 KiB
random_18.txt AC 2 ms 3512 KiB
random_19.txt AC 2 ms 3508 KiB
sample_01.txt AC 3 ms 3560 KiB