문제 링크: https://www.acmicpc.net/problem/15820

 

맞왜틀? 저도 뉴비때는 그랬습니다.. 물론 지금도 뉴비지만..

틀린 이유는 99.9% 확률로 틀려서 틀렸다고 나온겁니다. 0.1%는 데이터, 문제 오류인데 드뭅니다. 그리고 그게 있으면 보통 고인물 유저들이 assert로 빠르게 잡아내서 고칩니다.

그러니까 맞는거같은데 틀리다고 나오면 알고리즘을 다시 생각해봅시다.

#pragma GCC optimize ("Ofast")

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

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr), cout.tie(nullptr);

	int s1, s2;
	cin >> s1 >> s2;

	int sample_wrong = 0;
	int sys_wrong = 0;

	while (s1--) {
		int a, b;
		cin >> a >> b;
		if (a != b) ++sample_wrong;
	}

	while (s2--) {
		int a, b;
		cin >> a >> b;
		if (a != b) ++sys_wrong;
	}

	if (sample_wrong == 0 && sys_wrong == 0)
		cout << "Accepted";
	else if (sample_wrong > 0)
		cout << "Wrong Answer";
	else
		cout << "Why Wrong!!!";

	return 0;
}

 

반응형