QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#402512#8118. Pahuljicelfxxx#50 ✓1ms3936kbC++171.6kb2024-04-30 18:50:452024-04-30 18:50:45

Judging History

你现在查看的是最新测评结果

  • [2024-04-30 18:50:45]
  • 评测
  • 测评结果:50
  • 用时:1ms
  • 内存:3936kb
  • [2024-04-30 18:50:45]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(x) (x).begin(), (x).end()
bool be;
constexpr int N = 55;
char s[N][N];
int x[8], y[8];
int calc(int xx, int yy)
{
	x[0] = xx - 1, y[0] = yy - 1;
	x[1] = xx - 1, y[1] = yy;
	x[2] = xx - 1, y[2] = yy + 1;
	x[3] = xx, y[3] = yy - 1;
	x[4] = xx, y[4] = yy + 1;
	x[5] = xx + 1, y[5] = yy - 1;
	x[6] = xx + 1, y[6] = yy;
	x[7] = xx + 1, y[7] = yy + 1;
	int ans = 0;
//	cerr << x[2] << ' ' << y[2] << '\n';
//	cerr << s[x[2]][y[2]];
//	cerr << (s[x[0]][y[0]] == '\\' && s[x[1]][y[1]] == '|' && s[x[2]][y[2]] == '/');
	while (s[x[0]][y[0]] == '\\' && s[x[1]][y[1]] == '|' && s[x[2]][y[2]] == '/' && s[x[3]][y[3]] == '-' && s[x[4]][y[4]] == '-' && s[x[5]][y[5]] == '/' && s[x[6]][y[6]] == '|' && s[x[7]][y[7]] == '\\') {
		--x[0], --y[0];
		--x[1];
		--x[2], ++y[2];
		--y[3];
		++y[4];
		++x[5], --y[5];
		++x[6];
		++x[7], ++y[7];
		++ans;
	}
	return ans;
}
bool en;
int main()
{
	cerr << (&be - &en) / 1024.0 / 1024 << " MB\n--------------------------------" << endl;
#ifdef IAKIOI
	freopen("in.in", "r", stdin);
//	freopen("out.out", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n, m;
	cin >> n >> m;
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j) {
			cin >> s[i][j];
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j) {
			if (s[i][j] == '+') {
				ans = max(ans, calc(i, j));
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 1ms
memory: 3820kb

input:

10 10
.\|/......
.-+-\|/...
./|\-+-...
..\|/|\...
..-+-.....
../|\\|/..
.....-+-..
...../|\..
..........
..........

output:

1

result:

ok single line: '1'

Test #2:

score: 11
Accepted
time: 0ms
memory: 3936kb

input:

20 20
......\|/...........
......-+-...........
....../|\.......\|/.
........\|/.\|/.-+-.
........-+-.-+-./|\.
\|/...../|\./|\.\|/.
-+-...\|/.\|/...-+-.
/|\...-+-.-+-.../|\.
...\|//|\./|\.......
...-+-..............
.../|\..............
..........\|/.......
.......\|/-+-.......
.......-+-/|\..\|/..
...

output:

1

result:

ok single line: '1'

Test #3:

score: 11
Accepted
time: 1ms
memory: 3848kb

input:

50 50
......\|/.....................................\|/.
......-+-.\|/.................................-+-.
....../|\.-+-.........\|/.\|/.\|/..........\|//|\.
........../|\|/.......-+-.-+-.-+-..\|/.....-+-\|/.
............-+-\|/..\|/|\./|\./|\|/-+-\|/../|\-+-.
........\|/./|\-+-..-+-...\|/...-+-/|\-...

output:

1

result:

ok single line: '1'

Test #4:

score: 11
Accepted
time: 1ms
memory: 3848kb

input:

50 50
...................\|/............................
...................-+-.........\|/................
.......\|/........./|\.........-+-...........\|/..
.......-+-...................../|\...........-+-..
.\|/.../|\....\|/............\|/..\|/......../|\..
.-+-..........-+-\|/.........-+-..-+-.\...

output:

1

result:

ok single line: '1'

Test #5:

score: 11
Accepted
time: 0ms
memory: 3820kb

input:

10 10
..+..\/..-
/.--|\+..+
/..--++.|.
|.-+.-....
...+....+.
.\.\/..+|-
+.|\|..++.
..\\|\\|..
.-.-\|-/..
+\//.+--.\

output:

0

result:

ok single line: '0'

Test #6:

score: 11
Accepted
time: 1ms
memory: 3856kb

input:

20 20
../.||..+.\|+/..\\\\
|++.+./....\\/..++..
..+/...+|//+.|/.\|.\
\|..|..\.\+\..|-.\.-
|\.+-\.....-..|..+.|
.\-+...+///+.|.....+
\-/\...-..../.|/+.+.
-.....++|/+..-...\-\
-+..+...\-..++.+-../
//+.+.++.-|//../+.\|
.|...\..../../+.|+-.
\/---\..-|/\/......\
|||./+-./.|.\\|./|--
./|.\....\+...\/..+|
...

output:

0

result:

ok single line: '0'

Test #7:

score: 11
Accepted
time: 0ms
memory: 3900kb

input:

50 50
|\/.+/.+../....-+\..../+/../-/.|-./...\..+-\+.|.|+
\.-.-..../..|-......|-\..+.\..|.\...-/..-..\-|.|/-
./\..+/.-++/\-+./\+.\.-|+.....++.|-....\./|..-\--.
.\./.|.../../..|./.../\.+..+\.../......-|-.//...|+
\../.+-../.../.|..|../+......//./.-+\+.\/-|\++/+..
../.\...\\..|..\.-/.-|\.+||.|../\\\..+....

output:

0

result:

ok single line: '0'

Test #8:

score: 11
Accepted
time: 0ms
memory: 3768kb

input:

50 50
.....\.++...+.....+./.-..-....|..\--....+.+..\.../
|+.+-.|..++|...+|.++.|.../..+.|.+...\\.-+..+./\-/-
.....\-.\/-\/\-/.-/...\++...+\|\.\...//.-|\....\\/
...-.../+/.|\\.\+..-//../..|--..\+.++\.+|..|+|\../
./+.-\-+..||\..|-/....-.|\/-./\\-+.|..|/\-../...-+
--|.|-||\-.....\..-|-../\...+-|.\-+\..\...

output:

0

result:

ok single line: '0'

Subtask #2:

score: 11
Accepted

Test #9:

score: 11
Accepted
time: 0ms
memory: 3704kb

input:

5 5
.|../
.|./.
\|/..
-+---
/|\..

output:

1

result:

ok single line: '1'

Test #10:

score: 11
Accepted
time: 0ms
memory: 3828kb

input:

10 10
.\/|.//...
./-|..../.
---+------
.\/|\.....
././.\..\.
/..|..\...
...|...\\.
...|....\.
...|.--\/\
...|..\...

output:

0

result:

ok single line: '0'

Test #11:

score: 11
Accepted
time: 0ms
memory: 3896kb

input:

20 20
/.......././.\....|.
......../.....\...|.
...............\..|.
................\.|.
../..............\|/
\-----------------+-
......./.\......./|\
..................|.
.............../..|.
............./....|.
............./....|.
............/...../.
.........../......|.
.......././.......|.
...

output:

1

result:

ok single line: '1'

Test #12:

score: 11
Accepted
time: 1ms
memory: 3828kb

input:

20 20
...............|....
\..............|....
.\.............|....
|.\............|....
.-.\..\........|....
....\..........|....
.....\.........|....
......\...|....|.-..
.......\.......|.|..
....-...\......|....
.....-...\.....|....
..........\....|....
|..........\...|.../
............\..|../.
...

output:

0

result:

ok single line: '0'

Test #13:

score: 11
Accepted
time: 0ms
memory: 3780kb

input:

50 50
.....-\............/....|...........\......|......
/........./...-.|\..\..-.............\.../.|...../
.../...-\.....-/..-........../|......./....|..../.
.....\...|......./................/....\...|..//.\
.................|.........././...|.....\/.|../...
.......\.........\.../........\....\./\...

output:

2

result:

ok single line: '2'

Test #14:

score: 11
Accepted
time: 0ms
memory: 3828kb

input:

50 50
-........./....../......||........../.............
../\....//.-.......|.....|........................
..-..../.................|..........-.........-...
.................../.\...|...../............/....-
..|.|....\-..../...|....-||.......-...-......\./..
...-././.....-....\..-...|./..............

output:

3

result:

ok single line: '3'

Test #15:

score: 11
Accepted
time: 0ms
memory: 3896kb

input:

50 50
..............\.\.......\.\........./....|........
.........................\...............|........
...............\..........\..............|../.....
.............\.............\..........\../........
..\.........................\\...........|........
...........\...\.............\.....\......

output:

7

result:

ok single line: '7'

Subtask #3:

score: 28
Accepted

Test #16:

score: 28
Accepted
time: 1ms
memory: 3900kb

input:

5 5
.|./\
\|/..
-+---
/|\..
.|.\/

output:

1

result:

ok single line: '1'

Test #17:

score: 28
Accepted
time: 1ms
memory: 3896kb

input:

10 10
......\|/.
.\.|./-+-.
..\|/./|\.
.--+--....
.\/|\/....
./\|/\....
.--+--....
../|\.\|/.
./.|.\-+-.
....../|\.

output:

2

result:

ok single line: '2'

Test #18:

score: 28
Accepted
time: 1ms
memory: 3936kb

input:

20 20
.\|/\|/\|/..\.|./...
.-+--+--+--..\|/....
./|\/|\/|\.---+---..
\.|././\|/\../|\....
.\|/...-+-../.|.\...
--+--../|\|/..|..\..
./|\.....-+-........
/.|.\..../|\.\..|../
....\..|../...\.|./.
.....\.|./.....\|/..
\|/...\|/.\|/---+---
-+-.---+---+-../|\..
/|\/../|\./|\./.|.\\
\|/../.|.\.../..|..\
...

output:

3

result:

ok single line: '3'

Test #19:

score: 28
Accepted
time: 0ms
memory: 3832kb

input:

30 30
.\.|./....\|/.\|/\|/\|/.......
..\|/.....-+-.-+--+--+-.\|/...
---+------/|\\/|\/|\/|\.-+----
../|\..\|/....\|/...\.|./|\...
./.|.\.-+-\|/--+--...\|/......
/..|..\/|\-+-./|\...--+--.....
...|...\\./|\/.||\|/./|\/..../
.|.|.../\\......|-+-/.|/\\../.
.|.|../..\\.....|/|\../...\/..
.|.../..\.|\/.....

output:

8

result:

ok single line: '8'

Test #20:

score: 28
Accepted
time: 0ms
memory: 3708kb

input:

40 40
...\..|../..\|/...\|/...\|/.............
....\.|./...-+-..--+--.--+--....\|/..\|/
.....\|/..../|\..\/|\/../|\.....-+-..-+-
...---+---....\|//\|/\./.|\\.|../|\../|\
..|../|\..|...-+---+--..../\.|./..\....\
\.|./.|.\.|.../|\./|\..../..\|/....\....
.\|/..|..\|\|/.../\|/\../.---+---\|/\...
--+---....

output:

10

result:

ok single line: '10'

Test #21:

score: 28
Accepted
time: 0ms
memory: 3900kb

input:

50 50
\|/..\|/...\|/......\.......|\.|./.\/.|../.....\|/
-+----+---.-+-\.|./..\...\|/|.\|/../\.|./\.|./.-+-
/|\../|\.../|\.\|/....\..-+-|--+--/..\|/..\|/../|\
..../.|.\.|./.--+--.\.|\//|\|./|\/----+----+--....
.../.\|/.\|/.../|\...\|/\...|/.|/\.../|\../|\.....
.|./.-+---+--./\|/\.--+--\..|../..../.|...

output:

8

result:

ok single line: '8'

Test #22:

score: 28
Accepted
time: 0ms
memory: 3900kb

input:

50 50
.\.|./...\.|./..\...\|/|....../........\.|./......
..\|/\.|./\|/....\..-+-|\|/../...\.|./..\|/.......
.--+--\|/--+--.\|/\./|\|-+-./.....\|/----+----\|/.
../|\--+--/|\..-+-.\...|/|\/.\|/.--+--../|\...-+-.
./\|/\/|\/\|/\./|\|/\..|../..-+-../|\../.|.\../|\.
..-+-/.|.\-+-....-+-.\.|./.../|\./.|.\/...

output:

7

result:

ok single line: '7'

Test #23:

score: 28
Accepted
time: 0ms
memory: 3852kb

input:

50 50
...\|/......\|/..\....|..../...\|/...\|/..\|/\|/..
...-+-\|/.---+---.\...|.../.\|/-+-...-+-.--+--+--.
.\|/|\-+-.../|\....\..|../..-+-/|\|/./|\../|\/|\..
.-+-../|\../.|.\....\.|./.../|\..-+-...../.|/\|.\.
./|\....../..|..\....\|/........./|\........\|/...
..--------------------+----------------...

output:

8

result:

ok single line: '8'

Test #24:

score: 28
Accepted
time: 1ms
memory: 3932kb

input:

50 50
........\|/\|/.\|/.\|/|.\|/....\.|./....\|/../...\
\...\|/--+--+---+-.-+-|.-+-.....\|/\|/.--+--/..\|/
.\..-+-./|\/|\./|\./|\|./|\....--+--+-../|\/...-+-
.|\./|\/.|/\||\/......|\...|...//|\/|\|/.|/\.\./|\
.|.\../.....\|/.\|/\|/|.\..|..//.|.\.-+-./....\...
.|..\/.\|/.--+---+--+-|..\.|./\.|./../|...

output:

22

result:

ok single line: '22'

Test #25:

score: 28
Accepted
time: 0ms
memory: 3820kb

input:

50 50
.|-./..|++/+|./-./\\\+.-..\-..|\/..//|/-..../.-.\+
/++....+-+...-|\-.-|+..\+...\\.../\../\-|.\-.+....
-.|.--|../--|.....--|.../\/.|-/-/./.-/+|./..-.+..\
|+.\../-|.--/+|..-/.|..-/+-\.-\.../\.\+.\../+-...-
|+.+...|+....\++..+/...+|...||+..\.|..\|../.\\--..
./.\.-\.-\+/-.|.++..-.\/-+|.|.-++..////...

output:

0

result:

ok single line: '0'

Test #26:

score: 28
Accepted
time: 1ms
memory: 3908kb

input:

50 50
+/+|.-/||.+|+-/+./../|.-/\|.+\\...+\\/.++//.-.\+|/
|....../...+/..|./-/-\||++-.\+.-|.\+|/-+\.\.-//\+\
\|..//|//.|.-..|\/.\..\||/\.\|+/-+-....+..|....\.-
++.\.|.+.\/.\+||/...\+./\..\.||.|.|..|||+\.-\|++..
+\..|.-....-/..-\++.-..|\|./.-\.+.-.|..+.--..\|\.\
./..../|..|-|+.|+|.++|...+||/|\/|.-..+....

output:

0

result:

ok single line: '0'

Test #27:

score: 28
Accepted
time: 1ms
memory: 3900kb

input:

50 50
||.+|+-..\+.\|\/-|....-|//+/|///\\\\|.-.-../.+\--.
+/+./||+-\....\.\|.-.||-../...\..././\/.+-+..//.|\
.\.\+-+--\...\.//.|//.\+.-//.+/+./-/.+|./.-...../-
|+\|.....+-.-....+-..\..-../\..|\--.\++....-/./+\/
./|\/-....|/\+-|\-.|--./+/|+-.-.+.+-..+\|..-..++|.
.+-..|..+.|+\..\|/-|-+/.+..|-/.|+\|+\/\...

output:

0

result:

ok single line: '0'

Extra Test:

score: 0
Extra Test Passed