QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#320138#8217. King's Dinnerucup-team2303#WA 1ms3600kbC++111.5kb2024-02-03 14:07:052024-02-03 14:07:05

Judging History

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

  • [2024-02-03 14:07:05]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3600kb
  • [2024-02-03 14:07:05]
  • 提交

answer

/*
60 + 0 + 100 + 64 = 224.
*/

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define L(i, j, k) for (int i = (j); i <= (k); i++)
#define R(i, j, k) for (int i = (j); i >= (k); i--)
#define pb push_back
#define pii pair<int, int>
inline int read()
{
	int sum = 0, nega = 1;
	char ch = getchar();
	while (ch > '9'||ch < '0')
	{
	    if (ch == '-') nega = -1;
		ch = getchar();
	}
	while (ch <= '9' && ch >= '0') sum = sum * 10 + ch - '0', ch = getchar();
	return sum * nega;
}
const int N = 109, mod = 998244353;
inline void add(int &x, int y) {x = (x + y) % mod;}
inline void del(int &x, int y) {x = (x - y + mod) % mod;}
int n, px, py, ans, pos;
bool mp[N][N]; 
inline void solve() 
{
	n = read(), ans = 0; 
	L(i, 1, n) 
		L(j, 1, n) mp[i][j] = 0; 
	px = (n + 1) / 2, py = (n + 1) / 3; 
	
	L(i, 0, (n + 1) / 2) 
	{
		int tx = i, ty = (n + 1 - i * 2) / 3; 
	//	cout << px << " " << py << " " << tx << " " << ty << endl; 
		if(tx * py + ty * px > ans) ans = tx * py + ty * px, pos = i; 
	}
	int nw = 1; 
	L(i, 1, pos) 
	{
		for (int j = 1; j < n; j += 3) mp[nw][j] = mp[nw][j + 1] = 1;
		nw += 2;  
	}
	L(i, 1, (n + 1 - pos * 2) / 3) 
	{
		for (int j = 1; j <= n; j += 2) mp[nw][j] = mp[nw + 1][j] = 1; 
		nw += 3; 
	}
	L(i, 1, n) 
	{
		L(j, 1, n) 
		{
			if(!mp[i][j]) putchar('.');
			else putchar('#'); 
		}
		puts("");
	}
	return ;
}
signed main()
{
	int T; 
	T = read();
	L(i, 1, T) solve(); 
	return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3556kb

input:

3
1
2
3

output:

.
#.
#.
#.#
#.#
...

result:

ok all tests correct (3 test cases)

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3600kb

input:

50
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

output:

.
#.
#.
#.#
#.#
...
##..
....
#.#.
#.#.
#.#.#
#.#.#
.....
#.#.#
#.#.#
##.##.
......
##.##.
......
#.#.#.
#.#.#.
##.##..
.......
#.#.#.#
#.#.#.#
.......
#.#.#.#
#.#.#.#
##.##.##
........
##.##.##
........
##.##.##
........
#.#.#.#.
#.#.#.#.
##.##.##.
.........
##.##.##.
.........
#.#.#.#.#
#.#.#.#.#
...

result:

wrong answer jury has the better answer: jans = 4, pans = 3 (test case 4)