Submission #00044


ソースコード

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
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <cstring>
#include <algorithm>
#include <vector>
//#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <map>
#include <numeric>
using namespace std;
#define elif else if
#define echo cout <<
#define read cin >>
#define fin << '\n'
#define finn cout << '\n'
#define forin(i, n) for ( int i = 0; i < n; i++ )
#define unless(flg) if(!(flg))
#define zu >>
#define und <<
#define alles(obj) obj.begin(), obj.end()
#define bash push_back
#define makePair make_pair
// type-define
#define String string
#define Stack stack
#define Queue queue
#define pQueue priority_queue
#define Vector vector
#define Pair pair
#define Map map
typedef long long llong;
typedef bool boolean;
typedef Pair<int,int> Pii;
typedef Vector<int> Vi;
// utils
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;
char mas[1010][1010];
int main(){
cin.tie(0); ios::sync_with_stdio(false);
int h, w;
int yh, yw;
read h >> w >> yh >> yw;
int hy = yh; int hw = yw;
for ( int i = 0; i < yh; i++ ) read mas[i];
for ( int i = hy-1; i != 0; i-- ) {
for ( int j = 0; j < hw; j++ ) {
if ( mas[i][j] == '.' && mas[i-1][j] == '#' ) {
mas[i][j] = '#';
mas[i-1][j] = '.';
}
}
}
int counter = 0;
if ( h < hy ) {
for ( int i = hy-1; hy-h <= i; i-- ) {
for ( int j = 0; j < hw; j++ ) {
if ( mas[i][j] == '#' ) counter++;
}
}
}
else {
for ( int i = 0; i < hy; i++ ) {
for ( int j = 0; j < hw; j++ ) {
if ( mas[i][j] == '#' ) counter++;
}
}
}
echo counter fin;
return 0;
}

ステータス

項目 データ
問題 0003 - 雛ちゃんとふろー
ユーザー名 r1825
投稿日時 2018-08-22 10:55:17
言語 C++14
状態 Wrong Answer
得点 0
ソースコード長 2006 Byte
最大実行時間 34 ms
最大メモリ使用量 1568 KB

セット

セット 得点 Cases
1 ALL 0 / 10 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 WA 22 ms 1248 KB
1
Input02 WA 25 ms 1568 KB
1
Input03 AC 25 ms 488 KB
1
Input04 WA 28 ms 652 KB
1
Input05 AC 24 ms 816 KB
1
Input06 AC 20 ms 988 KB
1
Input07 AC 16 ms 1036 KB
1
Input08 AC 27 ms 1340 KB
1
Input09 WA 23 ms 1396 KB
1
Input10 AC 24 ms 564 KB
1
Input11 AC 25 ms 596 KB
1
Input12 AC 27 ms 756 KB
1
Input13 AC 34 ms 924 KB
1
Input14 WA 27 ms 1220 KB
1
Input15 WA 25 ms 1272 KB
1
Input16 WA 23 ms 1324 KB
1
Input17 WA 22 ms 1500 KB
1
Input18 AC 22 ms 792 KB
1
Input19 WA 27 ms 824 KB
1
Input20 WA 19 ms 980 KB
1