QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#213517#3016. Flashing FluorescentsrbjwnbWA 0ms3608kbC++201.2kb2023-10-14 14:40:252023-10-14 14:40:25

Judging History

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

  • [2023-10-14 14:40:25]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3608kb
  • [2023-10-14 14:40:25]
  • 提交

answer

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int N = 1e2+5, M = 1e6+5;
const int MOD = 998244353, INF = 0x3f3f3f3f;
string r, c;
bool ans[N][N];
deque<int> res;
deque<int> t;
void solve() {
	cin >> r >> c;
	for(int i = 0; i < r.size(); i ++) {
		for(int j = 0; j < c.size(); j ++) ans[i][j] = true;
		if((c.size() % 2) != (r[i] - '0')) res.push_back(i);
	}
	int j = 0;
	for(int i = 0; i < c.size(); i ++) {
		if((r.size() % 2) != (c[i] - '0')) {
			t.push_back(i);
		}
	}
	if((t.size() - res.size()) % 2 == 1) {
		cout << -1 << endl;
		return ;
	}
	while(res.size() < t.size()) {
		res.push_front(0);
	}
	while(t.size() < res.size()) {
		t.push_front(0);
	}
	for(int i = 0; i < t.size(); i ++) {
		ans[res[i]][t[i]] = false;
	}
	for(int i = t.size(); i < res.size(); i ++) ans[res[i]][0] = false;
	for(int i = 0; i < r.size(); i ++) {
		for(int j = 0; j < c.size(); j ++) cout << ans[i][j];
		cout << endl;
	}
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr), cout.tie(nullptr);
	int t = 1;
	//cin >> t;
	while(t --) solve();
	
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3608kb

input:

1101

output:

-1

result:

wrong answer 1st numbers differ - expected: '1', found: '-1'