mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-05-10 16:20:27 +08:00
Upload codes: contests
This commit is contained in:
parent
20088c4a66
commit
b6243b7378
34
AtCoder/abc390/A_12435.cpp
Normal file
34
AtCoder/abc390/A_12435.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define lo long long
|
||||||
|
#define INF INT_MAX
|
||||||
|
#define LLM LONG_LONG_MAX
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
/*
|
||||||
|
toothless. #17
|
||||||
|
@fredcss_dev
|
||||||
|
*/
|
||||||
|
|
||||||
|
int a[N], b[N];
|
||||||
|
|
||||||
|
signed main()
|
||||||
|
{
|
||||||
|
for (int i = 1; i <= 5; i++) {
|
||||||
|
cin >> a[i];
|
||||||
|
b[i] = a[i];
|
||||||
|
}
|
||||||
|
if (a[1] == 1 && a[2] == 2 && a[3] == 3 && a[4] == 4 && a[5] == 5) {
|
||||||
|
puts("No");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
sort(b + 1, b + 6);
|
||||||
|
int cnt = 0, r = 0;
|
||||||
|
for (int i = 1; i <= 5; i++) {
|
||||||
|
if (a[i] != b[i]) cnt++;
|
||||||
|
if (a[i] != b[i] && i != 1 && a[i - 1] != b[i - 1]) r = 1;
|
||||||
|
}
|
||||||
|
if (cnt == 2 && r == 1) puts("Yes");
|
||||||
|
else puts("No");
|
||||||
|
return 0;
|
||||||
|
}
|
33
AtCoder/abc390/B_Geometric_Sequence.cpp
Normal file
33
AtCoder/abc390/B_Geometric_Sequence.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define lo long long
|
||||||
|
#define INF INT_MAX
|
||||||
|
#define LLM LONG_LONG_MAX
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const lo N = 1e7 + 10;
|
||||||
|
/*
|
||||||
|
toothless. #17
|
||||||
|
@fredcss_dev
|
||||||
|
*/
|
||||||
|
|
||||||
|
lo n;
|
||||||
|
lo a[N], b;
|
||||||
|
bool flag = 0;
|
||||||
|
|
||||||
|
signed main()
|
||||||
|
{
|
||||||
|
cin >> n;
|
||||||
|
for (int i = 1; i <= n; i++) {
|
||||||
|
cin >> a[i];
|
||||||
|
}
|
||||||
|
for (int i = 3; i <= n; i++)
|
||||||
|
{
|
||||||
|
if (a[i] * a[1] != a[i - 1] * a[2])
|
||||||
|
{
|
||||||
|
puts("No");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
puts("Yes");
|
||||||
|
return 0;
|
||||||
|
}
|
60
AtCoder/abc390/C_Paint_to_make_a_rectangle.cpp
Normal file
60
AtCoder/abc390/C_Paint_to_make_a_rectangle.cpp
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define lo long long
|
||||||
|
#define INF INT_MAX
|
||||||
|
#define LLM LONG_LONG_MAX
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
/*
|
||||||
|
toothless. #17
|
||||||
|
@fredcss_dev
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool f(int h, int w, vector<string>& g)
|
||||||
|
{
|
||||||
|
int top = h, b = -1, l = w, r = -1;
|
||||||
|
for (int i = 0; i < h; i++) {
|
||||||
|
for (int j = 0; j < w; j++) {
|
||||||
|
if (g[i][j] == '#') {
|
||||||
|
top = min(top, i);
|
||||||
|
b = max(b, i);
|
||||||
|
l = min(l, j);
|
||||||
|
r = max(r, j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (b == -1) return true;
|
||||||
|
for (int i = top; i <= b; i++) {
|
||||||
|
for (int j = l; j <= r; j++) {
|
||||||
|
if (g[i][j] == '.') return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < h; i++) {
|
||||||
|
for (int j = 0; j < w; j++) {
|
||||||
|
if (i < top || i > b || j < l || j > r) {
|
||||||
|
if (g[i][j] == '#') return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
signed main()
|
||||||
|
{
|
||||||
|
int h, w;
|
||||||
|
cin >> h >> w;
|
||||||
|
if (h == 1 && w == 1) {
|
||||||
|
puts("Yes");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
vector<string> g(h);
|
||||||
|
for (int i = 0; i < h; i++) {
|
||||||
|
cin >> g[i];
|
||||||
|
}
|
||||||
|
if (f(h, w, g)) {
|
||||||
|
cout << "Yes" << endl;
|
||||||
|
} else {
|
||||||
|
cout << "No" << endl;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
30
AtCoder/abc391/A_Lucky_Direction.cpp
Normal file
30
AtCoder/abc391/A_Lucky_Direction.cpp
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define lo long long
|
||||||
|
#define INF INT_MAX
|
||||||
|
#define LLM LONG_LONG_MAX
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
/*
|
||||||
|
toothless. #17
|
||||||
|
@fredcss_dev
|
||||||
|
*/
|
||||||
|
|
||||||
|
map<string, string> mp;
|
||||||
|
|
||||||
|
string n;
|
||||||
|
|
||||||
|
signed main()
|
||||||
|
{
|
||||||
|
mp["N"] = "S";
|
||||||
|
mp["E"] = "W";
|
||||||
|
mp["W"] = "E";
|
||||||
|
mp["S"] = "N";
|
||||||
|
mp["NE"] = "SW";
|
||||||
|
mp["NW"] = "SE";
|
||||||
|
mp["SE"] = "NW";
|
||||||
|
mp["SW"] = "NE";
|
||||||
|
cin >> n;
|
||||||
|
cout << mp[n];
|
||||||
|
return 0;
|
||||||
|
}
|
48
AtCoder/abc391/B_Seek_Grid.cpp
Normal file
48
AtCoder/abc391/B_Seek_Grid.cpp
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define lo long long
|
||||||
|
#define INF INT_MAX
|
||||||
|
#define LLM LONG_LONG_MAX
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
/*
|
||||||
|
toothless. #17
|
||||||
|
@fredcss_dev
|
||||||
|
*/
|
||||||
|
|
||||||
|
signed main() {
|
||||||
|
int N, M;
|
||||||
|
cin >> N >> M;
|
||||||
|
|
||||||
|
vector<vector<char> > S(N, vector<char>(N));
|
||||||
|
vector<vector<char> > T(M, vector<char>(M));
|
||||||
|
for (int i = 0; i < N; ++i) {
|
||||||
|
for (int j = 0; j < N; ++j) {
|
||||||
|
cin >> S[i][j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < M; ++i) {
|
||||||
|
for (int j = 0; j < M; ++j) {
|
||||||
|
cin >> T[i][j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int a = 0; a <= N - M; ++a) {
|
||||||
|
for (int b = 0; b <= N - M; ++b) {
|
||||||
|
bool match = true;
|
||||||
|
for (int i = 0; i < M; ++i) {
|
||||||
|
for (int j = 0; j < M; ++j) {
|
||||||
|
if (S[a + i][b + j] != T[i][j]) {
|
||||||
|
match = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!match) break;
|
||||||
|
}
|
||||||
|
if (match) {
|
||||||
|
cout << a + 1 << " " << b + 1 << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
32
AtCoder/abc391/C_Pigeonhole_Query.cpp
Normal file
32
AtCoder/abc391/C_Pigeonhole_Query.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int n, q, mp[10005], g[10005], cnt = 0, a, b, c;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
cin >> n >> q;
|
||||||
|
for (int i = 0; i <= n; i++)
|
||||||
|
{
|
||||||
|
mp[i] = 1;
|
||||||
|
g[i] = i;
|
||||||
|
}
|
||||||
|
while (q--)
|
||||||
|
{
|
||||||
|
cin >> a;
|
||||||
|
if (a == 1)
|
||||||
|
{
|
||||||
|
cin >> b >> c;
|
||||||
|
if (mp[g[b]] == 2)
|
||||||
|
cnt--;
|
||||||
|
if (mp[c] == 1)
|
||||||
|
cnt++;
|
||||||
|
mp[g[b]]--;
|
||||||
|
mp[c]++;
|
||||||
|
g[b] = c;
|
||||||
|
}
|
||||||
|
else if (a == 2)
|
||||||
|
cout << cnt << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define lo long long
|
||||||
|
#define INF INT_MAX
|
||||||
|
#define LLM LONG_LONG_MAX
|
||||||
|
#define endl "\n"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
/*
|
||||||
|
toothless. #17
|
||||||
|
@fredcss_dev
|
||||||
|
*/
|
||||||
|
|
||||||
|
int t, k;
|
||||||
|
|
||||||
|
bool wczffl_503(int k) {
|
||||||
|
return (k % 3 == 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
signed main() {
|
||||||
|
cin >> t;
|
||||||
|
while (t--){
|
||||||
|
cin >> k;
|
||||||
|
if (wczffl_503(k)) cout << "YES" << endl;
|
||||||
|
else cout << "NO" << endl;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
76
CodeForces/Codeforces Round 1007 (Div. 2)/B_Perfecto.cpp
Normal file
76
CodeForces/Codeforces Round 1007 (Div. 2)/B_Perfecto.cpp
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define lo long long
|
||||||
|
#define INF INT_MAX
|
||||||
|
#define LLM LONG_LONG_MAX
|
||||||
|
#define endl "\n"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
/*
|
||||||
|
toothless. #17
|
||||||
|
@fredcss_dev
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool f(lo x) {
|
||||||
|
if (x < 0) return false;
|
||||||
|
lo root = sqrtl(x);
|
||||||
|
return root * root == x;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wczffl_503() {
|
||||||
|
int n;
|
||||||
|
cin >> n;
|
||||||
|
lo total = 1LL * n * (n + 1) / 2;
|
||||||
|
if (f(total)) {
|
||||||
|
cout << "-1\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
vector<lo> s(n + 1);
|
||||||
|
for (int i = 1; i <= n; ++i) {
|
||||||
|
s[i] = (2LL * n - i + 1) * i / 2;
|
||||||
|
}
|
||||||
|
vector<bool> jhd(n + 1, false);
|
||||||
|
for (int i = 1; i <= n - 1; ++i) {
|
||||||
|
if (f(s[i])) {
|
||||||
|
jhd[i] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool bad = false;
|
||||||
|
for (int i = 1; i <= n; ++i) {
|
||||||
|
lo now = s[i];
|
||||||
|
if (i <= n - 1 && jhd[i]) {
|
||||||
|
now--;
|
||||||
|
}
|
||||||
|
if (f(now)) {
|
||||||
|
bad = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bad) {
|
||||||
|
cout << "-1\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
vector<int> p(n);
|
||||||
|
for (int i = 0; i < n; ++i) {
|
||||||
|
p[i] = n - i;
|
||||||
|
}
|
||||||
|
for (int i = 1; i <= n - 1; ++i) {
|
||||||
|
if (jhd[i]) {
|
||||||
|
swap(p[i - 1], p[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int x : p) {
|
||||||
|
cout << x << ' ';
|
||||||
|
}
|
||||||
|
cout << '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
signed main()
|
||||||
|
{
|
||||||
|
int t;
|
||||||
|
cin >> t;
|
||||||
|
while (t--) {
|
||||||
|
wczffl_503();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define lo long long
|
||||||
|
#define INF INT_MAX
|
||||||
|
#define LLM LONG_LONG_MAX
|
||||||
|
#define endl "\n"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
/*
|
||||||
|
toothless. #17
|
||||||
|
@fredcss_dev
|
||||||
|
*/
|
||||||
|
|
||||||
|
vector<int> f(int root, const vector<vector<int>>& adj) {
|
||||||
|
vector<int> post_order;
|
||||||
|
stack<tuple<int, int, bool>> s;
|
||||||
|
s.push({root, -1, false});
|
||||||
|
|
||||||
|
while (!s.empty()) {
|
||||||
|
auto [node, parent, visited] = s.top();
|
||||||
|
s.pop();
|
||||||
|
if (visited) {
|
||||||
|
post_order.push_back(node);
|
||||||
|
} else {
|
||||||
|
s.push({node, parent, true});
|
||||||
|
for (int neighbor : adj[node]) {
|
||||||
|
if (neighbor != parent) {
|
||||||
|
s.push({neighbor, node, false});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return post_order;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wczffl_503() {
|
||||||
|
int t;
|
||||||
|
cin >> t;
|
||||||
|
while (t--) {
|
||||||
|
int n, st, en;
|
||||||
|
cin >> n >> st >> en;
|
||||||
|
vector<vector<int>> adj(n + 1);
|
||||||
|
for (int i = 0; i < n - 1; ++i) {
|
||||||
|
int u, v;
|
||||||
|
cin >> u >> v;
|
||||||
|
adj[u].push_back(v);
|
||||||
|
adj[v].push_back(u);
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<int> p = f(en, adj);
|
||||||
|
if (p.back() != en) {
|
||||||
|
p.push_back(en);
|
||||||
|
}
|
||||||
|
for (int x : p) {
|
||||||
|
cout << x << ' ';
|
||||||
|
}
|
||||||
|
cout << '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
wczffl_503();
|
||||||
|
return 0;
|
||||||
|
}
|
58
Luogu/P_1015_NOIP_1999_普及组_回文数.cpp
Normal file
58
Luogu/P_1015_NOIP_1999_普及组_回文数.cpp
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define int long long
|
||||||
|
#define endl "\n"
|
||||||
|
#define IMX LONG_LONG_MAX
|
||||||
|
#define IMN LONG_LONG_MIN
|
||||||
|
#define debug$ if (dev)
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
/* toothless. #17 */
|
||||||
|
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
const int M = 2e3 + 5;
|
||||||
|
const bool dev = false;
|
||||||
|
|
||||||
|
char s[M];
|
||||||
|
int a[M], top;
|
||||||
|
bool check()
|
||||||
|
{
|
||||||
|
int t = top / 2;
|
||||||
|
for (int i = 0; i <= t; ++i)
|
||||||
|
if (a[i] != a[top - i])
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
signed main()
|
||||||
|
{
|
||||||
|
ios::sync_with_stdio(0);
|
||||||
|
cin.tie(0);
|
||||||
|
cout.tie(0);
|
||||||
|
int n, step = 0;
|
||||||
|
cin >> n >> s;
|
||||||
|
top = strlen(s) - 1;
|
||||||
|
for (int i = 0; i <= top; ++i)
|
||||||
|
if (s[i] >= '0' && s[i] <= '9')
|
||||||
|
a[top - i] = s[i] - '0';
|
||||||
|
else
|
||||||
|
a[top - i] = s[i] - 55;
|
||||||
|
while (check()) {
|
||||||
|
if (step > 30) {
|
||||||
|
cout << "Impossible!";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
for (int i = 0; i <= top; ++i)
|
||||||
|
if (top - i >= i)
|
||||||
|
a[i] += a[top - i];
|
||||||
|
else
|
||||||
|
a[i] = a[top - i];
|
||||||
|
for (int i = 0; i <= top; ++i)
|
||||||
|
if (a[i] >= n)
|
||||||
|
a[i + 1]++, a[i] -= n;
|
||||||
|
if (a[top + 1])
|
||||||
|
top++;
|
||||||
|
step++;
|
||||||
|
}
|
||||||
|
cout << "STEP=" << step;
|
||||||
|
return 0;
|
||||||
|
}
|
34
Luogu/P_10446_64_位整数乘法.cpp
Normal file
34
Luogu/P_10446_64_位整数乘法.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define lo long long
|
||||||
|
#define IMX LONG_LONG_MAX
|
||||||
|
#define IMN LONG_LONG_MIN
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
/*
|
||||||
|
toothless. #17
|
||||||
|
@fredcss_dev
|
||||||
|
*/
|
||||||
|
|
||||||
|
lo qpow(lo a, lo b, lo p) {
|
||||||
|
lo result = 0;
|
||||||
|
while (b) {
|
||||||
|
if (b & 1) {
|
||||||
|
result += a;
|
||||||
|
result %= p;
|
||||||
|
}
|
||||||
|
b >>= 1;
|
||||||
|
a += a;
|
||||||
|
a %= p;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
lo a, b, p;
|
||||||
|
|
||||||
|
signed main()
|
||||||
|
{
|
||||||
|
cin >> a >> b >> p;
|
||||||
|
cout << qpow(a, b, p);
|
||||||
|
return 0;
|
||||||
|
}
|
27
Luogu/P_1060_NOIP_2006_普及组_开心的金明.cpp
Normal file
27
Luogu/P_1060_NOIP_2006_普及组_开心的金明.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define lo long long
|
||||||
|
#define IMX LONG_LONG_MAX
|
||||||
|
#define IMN LONG_LONG_MIN
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
/*
|
||||||
|
toothless. #17
|
||||||
|
@fredcss_dev
|
||||||
|
<2025/1/21>
|
||||||
|
*/
|
||||||
|
|
||||||
|
int m, n, d[N], w, v;
|
||||||
|
|
||||||
|
signed main()
|
||||||
|
{
|
||||||
|
cin >> m >> n;
|
||||||
|
for(int i = 1; i <= n; i++) {
|
||||||
|
cin >> v >> w;
|
||||||
|
for(int j = m; j >= v; j--){
|
||||||
|
d[j] = max(d[j], d[j - v] + w * v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("%d",d[m]);
|
||||||
|
return 0;
|
||||||
|
}
|
49
Luogu/P_1135_奇怪的电梯.cpp
Normal file
49
Luogu/P_1135_奇怪的电梯.cpp
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
#define int long long
|
||||||
|
#define endl "\n"
|
||||||
|
#define IMX LONG_LONG_MAX
|
||||||
|
#define IMN LONG_LONG_MIN
|
||||||
|
#define debug$ if(dev)
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
/* toothless. #17 */
|
||||||
|
|
||||||
|
const int N = 1e7 + 10;
|
||||||
|
const int M = 2e3 + 5;
|
||||||
|
const bool dev = false;
|
||||||
|
|
||||||
|
int n, k;
|
||||||
|
int a[N];
|
||||||
|
int ans=0;
|
||||||
|
|
||||||
|
bool isPrime(int x)
|
||||||
|
{
|
||||||
|
if (x == 1)
|
||||||
|
return false;
|
||||||
|
for (int i = 2; i * i <= x; i++)
|
||||||
|
if (x % i == 0)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void dfs(int x, int sum, int cnt)
|
||||||
|
{
|
||||||
|
if (x == k) {
|
||||||
|
if (isPrime(sum))
|
||||||
|
ans++;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i = cnt; i < n; i++) {
|
||||||
|
dfs(x + 1, sum + a[i], i + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signed main()
|
||||||
|
{
|
||||||
|
cin >> n;
|
||||||
|
for (int i = 1; i <= n; i++)
|
||||||
|
cin >> a[i];
|
||||||
|
dfs(0, 0, 0);
|
||||||
|
cout << ans << endl;
|
||||||
|
return 0;
|
||||||
|
}`
|
@ -10,6 +10,7 @@ Here's my personal solutions to algorithm problems.
|
|||||||
|
|
||||||
| Name | Link | Account
|
| Name | Link | Account
|
||||||
| :---: | :---: | :---: |
|
| :---: | :---: | :---: |
|
||||||
|
| AtCoder | atcoder.jp | [wczffL_4ever](https://atcoder.jp/users/wczffL_4ever) |
|
||||||
| Codeforces | codeforces.com | [Fengyi_Chen](https://codeforces.com/profile/Fengyi_Chen) |
|
| Codeforces | codeforces.com | [Fengyi_Chen](https://codeforces.com/profile/Fengyi_Chen) |
|
||||||
| FZOI | 内部 OJ | 内部 OJ |
|
| FZOI | 内部 OJ | 内部 OJ |
|
||||||
| Luogu | luogu.com.cn | [BunDragon126](https://www.luogu.com.cn/user/927203) |
|
| Luogu | luogu.com.cn | [BunDragon126](https://www.luogu.com.cn/user/927203) |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user