0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-30 15:56:27 +00:00

T258573 [Aya Round 1 B] 幻想乡麻将游戏

https://www.luogu.com.cn/record/82791696
This commit is contained in:
Baoshuo Ren 2022-08-07 14:13:44 +08:00
parent bba92de9e1
commit 06e8fe6606
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

37
Luogu/T258573/T258573.cpp Normal file
View File

@ -0,0 +1,37 @@
#include <iostream>
#include <algorithm>
using std::cin;
using std::cout;
const char endl = '\n';
int t, a[10], p[10];
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> t;
while (t--) {
bool flag = false;
for (int i = 1; i <= 4; i++) {
cin >> a[i];
}
for (a[5] = 0; a[5] <= 9; a[5]++) {
for (int i = 1; i <= 5; i++) {
p[i] = i;
}
do {
if (a[p[1]] - 1 == a[p[2]] && a[p[2]] == a[p[3]] + 1 && a[p[4]] == a[p[5]]) flag = true;
} while (std::next_permutation(p + 1, p + 1 + 5));
}
cout << flag << endl;
}
return 0;
}