結果

提出番号 1619
提出者 Ryoga_0212
言語 C++
提出日時 2018-08-04 13:17:21
問題名 (69)机の配置
結果 AC
点数 100%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 2ms 7248KB
2 AC 100% 2ms 8688KB
3 AC 100% 2ms 7616KB
4 AC 100% 2ms 8720KB
5 AC 100% 2ms 7904KB
6 AC 100% 2ms 8464KB
7 AC 100% 2ms 8720KB
8 AC 100% 2ms 8720KB
9 AC 100% 2ms 8016KB
10 AC 100% 2ms 8432KB
11 AC 100% 2ms 7984KB
12 AC 100% 2ms 7520KB
13 AC 100% 2ms 8048KB
14 AC 100% 2ms 8096KB
15 AC 100% 2ms 8416KB
16 AC 100% 2ms 8432KB
17 AC 100% 1ms 8336KB
18 AC 100% 1ms 8416KB
19 AC 100% 2ms 8416KB
20 AC 100% 2ms 8448KB
21 AC 100% 2ms 8192KB
22 AC 100% 2ms 8432KB
23 AC 100% 2ms 7808KB
24 AC 100% 2ms 8720KB
25 AC 100% 2ms 8064KB
26 AC 100% 2ms 8432KB
27 AC 100% 2ms 8432KB
28 AC 100% 2ms 7520KB
29 AC 100% 2ms 7648KB
30 AC 100% 2ms 7952KB

ソースコード

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;

int a[100][100], b[100][100];
int n, h, w;
int ok(int y, int x, int t){
	int f = 1;
	rep(i,t)if(b[y][x+i] == 1)f = 0;
	if(f)rep(i,t)b[y][x+i] = 1;
	return f;
}

int solve(int t){
	int res = 0;
	fill((int*)b, (int*)(b+100), 1);
	rep(i,h)rep(j,w)b[i][j] = a[i][j];
	rep(i,h)rep(j,w)res += ok(i, j, t);
	return res;
}

signed main(){
	scanf("%lld%lld%lld", &n, &h, &w);
	rep(i,h){
		string str;
		cin >> str;
		rep(j,w)a[i][j] = (str[j] == '#');
	}
	
	rep(i,n){
		int res = solve(i+1);
		printf("%lld\n", res);
	}
	return 0;
}