제출 #524943

#제출 시각아이디문제언어결과실행 시간메모리
524943ZielL-triominoes (CEOI21_ltriominoes)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define sz(x) (int)x.size()

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	int w, h, k;
	cin >> w >> h >> k;

	if (!k) {
		if (w == 2) {
			if (h % 3 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}

		else if (w == 3) {
			if (h % 2 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}

		else if (w == 4) {
			if (h % 3 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}

		else if (w == 5) {
			if (h % 6 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}

		else if (w == 6) {
			if (h % 2 == 0 || h % 3 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}
		assert(false);

		else if (w == 7) {
			if (h % 6 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}

		else if (w == 8) {
			if (h % 3 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}

		else if (w == 9) {
			if (h % 2 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}

		else if (w == 10) {
			if (h % 3 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}

		else if (w == 11) {
			if (h % 6 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}

		else if (w == 12) {
			if (h % 2 == 0 || h % 3 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}

		else if (w == 13) {
			if (h % 6 == 0)
				cout << "YES\n";
			else
				cout << "NO\n";
		}
	}

	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

ltrominoes.cpp: In function 'int main()':
ltrominoes.cpp:51:3: error: expected '}' before 'else'
   51 |   else if (w == 7) {
      |   ^~~~
ltrominoes.cpp:14:10: note: to match this '{'
   14 |  if (!k) {
      |          ^
ltrominoes.cpp: At global scope:
ltrominoes.cpp:101:2: error: expected unqualified-id before 'return'
  101 |  return 0;
      |  ^~~~~~
ltrominoes.cpp:102:1: error: expected declaration before '}' token
  102 | }
      | ^