0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

Move Codeforces Codes

This commit is contained in:
Baoshuo Ren 2022-09-25 20:39:35 +08:00
parent 3471c32f09
commit 964ead51b2
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
36 changed files with 0 additions and 101 deletions

View File

@ -1,22 +0,0 @@
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int t, inv[100005];
long long n, ans;
int main() {
cin >> t;
while (t--) {
ans = 1;
cin >> n;
n *= 2;
while (n) {
ans = ans * n-- % mod;
}
cout << ans * 500000004 % mod << endl;
}
return 0;
}

View File

@ -1,25 +0,0 @@
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
int t, n;
string s[2];
bool flag;
int main() {
std::ios::sync_with_stdio(false);
cin >> t;
while (t--) {
flag = true;
cin >> n >> s[0] >> s[1];
for (int i = 0; i < n; i++) {
if (s[0][i] == '1' && s[1][i] == '1') {
flag = false;
}
}
cout << (flag ? "YES" : "NO") << endl;
}
return 0;
}

View File

@ -1,38 +0,0 @@
#include <bits/stdc++.h>
using namespace std;
int t, n, cnt, l, r, a[1005][6];
bool flag;
int main() {
cin >> t;
while (t--) {
flag = false;
cin >> n;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= 5; j++) {
cin >> a[i][j];
}
}
for (int i = 1; i <= 5; i++) {
for (int j = i + 1; j <= 5; j++) {
cnt = l = r = 0;
for (int k = 1; k <= n; k++) {
if (a[k][i] == 1 && a[k][j] == 1) {
cnt++;
} else {
l += a[k][i];
r += a[k][j];
}
}
if (cnt + l + r == n && l <= n / 2 && r <= n / 2) {
flag = true;
break;
}
}
}
cout << (flag ? "Yes" : "No") << endl;
}
return 0;
}

View File

@ -1,16 +0,0 @@
#include <bits/stdc++.h>
using namespace std;
int t;
string s;
int main() {
cin >> t;
while (t--) {
cin >> s;
s[0] = *s.rbegin();
cout << s << endl;
}
return 0;
}