QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#223483#6743. water235luanmenglei#WA 1ms3436kbC++171.0kb2023-10-22 10:16:282023-10-22 10:16:28

Judging History

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

  • [2023-10-22 10:16:28]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3436kb
  • [2023-10-22 10:16:28]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

void debug(const char *msg, ...) {
#ifdef CLESIP
    va_list arg;
    static char pbString[512];
    va_start(arg,msg);
    vsprintf(pbString,msg,arg);
    cerr << "[DEBUG] " << pbString << "\n";
    va_end(arg);
#endif    
}

#define PASSED debug("PASSED (%s) LINE #%s", __FUNCTION__, __LINE__)

using i64 = long long;
using i128 = __int128_t;
template <typename T, typename L> void chkmax(T &x, L y) { if (x < y) x = y; }
template <typename T, typename L> void chkmin(T &x, L y) { if (x > y) x = y; }

void solve() {
	int n, m; cin >> n >> m;
	vector<vector<int>> ans(n + 1, vector<int>(m + 1));

	ans[1][1] = 1;
	int cnt = 1;
	for (int i = (m % 2 + 2); i <= m; i ++)
		ans[1][i] = 1, ++ cnt;	
	for (int i = (n % 2 + 2); i <= n; i ++)
		ans[i][1] = 1, ++ cnt;
	
	cout << cnt << "\n";
	for (int i = 1; i <= n; i ++)
		for (int j = 1; j <= m; j ++)
			cout << ans[i][j] << " \n"[j == m];
}

signed main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3424kb

input:

2 1

output:

2
1
1

result:

ok The answer is correct.

Test #2:

score: 0
Accepted
time: 1ms
memory: 3432kb

input:

3 3

output:

3
1 0 1
0 0 0
1 0 0

result:

ok The answer is correct.

Test #3:

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

input:

1 4

output:

4
1 1 1 1

result:

wrong answer The answer is wrong: expected = 3, found = 4