QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#750512#7779. Swiss Stagezhenghanyun#AC ✓0ms3648kbC++14632b2024-11-15 14:47:252024-11-15 14:47:26

Judging History

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

  • [2024-11-15 14:47:26]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3648kb
  • [2024-11-15 14:47:25]
  • 提交

answer

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

typedef long long ll;

int x, y, ans;

inline void dfs(int x, int y) {
	if (x >= 3) {
		return;
	}
	if (x == 0 && y == 0) {
		++ans;
	} else if (x == 1 && y == 0) {
		++ans;
	} else if (x == 0 && y == 1) {
		++ans;
	} else if (x == 1 && y == 1) {
		++ans;
	} else {
		ans += 2;
	}
	dfs(x + 1, y);
}

int main() {
	#ifdef LOCAL
		assert(freopen("test.in", "r", stdin));
		assert(freopen("test.out", "w", stdout));
	#endif
	ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
	cin >> x >> y;
	dfs(x, y);
	cout << ans << "\n";
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3556kb

input:

0 1

output:

4

result:

ok 1 number(s): "4"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

1 2

output:

4

result:

ok 1 number(s): "4"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

0 0

output:

4

result:

ok 1 number(s): "4"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

0 2

output:

6

result:

ok 1 number(s): "6"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

1 0

output:

3

result:

ok 1 number(s): "3"

Test #6:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

1 1

output:

3

result:

ok 1 number(s): "3"

Test #7:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

2 0

output:

2

result:

ok 1 number(s): "2"

Test #8:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

2 1

output:

2

result:

ok 1 number(s): "2"

Test #9:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

2 2

output:

2

result:

ok 1 number(s): "2"

Extra Test:

score: 0
Extra Test Passed