QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#213528#3016. Flashing FluorescentsrbjwnbWA 0ms3480kbC++201.3kb2023-10-14 14:44:252023-10-14 14:44:25

Judging History

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

  • [2023-10-14 14:44:25]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3480kb
  • [2023-10-14 14:44: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;
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);
	}
	deque<int> t;
	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() && (t.size() - res.size()) % 2 == 1) {
		cout << -1 << endl;
		return ;
	}
	if(t.size() < res.size() && (res.size() - t.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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1101

output:

-1

result:

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