Submission #39369
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | #include <iostream> #include <string> #include <stack> #include <queue> #include <cstring> #include <algorithm> #include <vector> //#include <cstdio> #include <cmath> #include <cstdlib> #include <functional> using namespace std; #define elif else if #define echo cout << #define read cin >> #define then { #define elsee else { #define _do { #define done } #define fi } #define fin << '\n' #define finn cout << '\n' typedef long long ll; typedef bool boolean; typedef pair< int , int > pii; typedef pair<pii, pii> piiii; typedef pair<piiii, piiii> piiiiiiii; typedef pair<piiiiiiii, piiiiiiii> piiiiiiiiiiiiiiii; typedef pair<piiiiiiiiiiiiiiii, piiiiiiiiiiiiiiii> piiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii; typedef pair<piiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii, piiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii> piiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii; const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}; const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1}; boolean canMove( int x, int y, int w, int h){ return (x>=0&&y>=0&&x<w&&y<h);}; const int INF = 1 << 29; string mp[110]; int main(){ cin.tie(0); ios::sync_with_stdio( false ); int count = 0; int n, m, d; read n >> m >> d; for ( int i = 0; i < n; i++ ) { read mp[i]; } for ( int i = 0; i < n; i++ ) { for ( int j = 0; j < m; j++ ) { if ( mp[i][j] == '.' ) { boolean flg = true ; for ( int k = j; k < j+d; k++) { if ( k < m ) { if ( mp[i][k] == '#' ) { flg = false ; break ; } } else { flg = false ; break ; } } if ( flg ) { count++; } flg = true ; for ( int k = i; k < i+d; k++) { if ( k < n ) { if ( mp[k][j] == '#' ) { flg = false ; break ; } } else { flg = false ; break ; } } if ( flg ) { count++; } } } } echo count fin; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0594 - 休憩スペース (Refreshment Area) |
ユーザー名 | r1825 |
投稿日時 | 2018-07-23 11:31:25 |
言語 | C++11 |
状態 | Accepted |
得点 | 99 |
ソースコード長 | 2497 Byte |
最大実行時間 | 35 ms |
最大メモリ使用量 | 516 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | set1 | 20 / 20 | *t3*1.txt |
2 | set2 | 20 / 20 | *t3*2.txt |
3 | set3 | 20 / 20 | *t3*3.txt |
4 | set4 | 20 / 20 | *t3*4.txt |
5 | set5 | 20 / 20 | *t3*5.txt |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # | ||||
---|---|---|---|---|---|---|---|---|
2017-yo-t3-in1.txt | AC | 35 ms | 480 KB |
1
|
||||
2017-yo-t3-in2.txt | AC | 31 ms | 436 KB |
2
|
||||
2017-yo-t3-in3.txt | AC | 24 ms | 512 KB |
3
|
||||
2017-yo-t3-in4.txt | AC | 26 ms | 448 KB |
4
|
||||
2017-yo-t3-in5.txt | AC | 19 ms | 516 KB |
5
|