Clean up repo
This commit is contained in:
parent
14e6de8bd0
commit
39af2624d5
71
.vscode/settings.json
vendored
71
.vscode/settings.json
vendored
|
@ -1,5 +1,74 @@
|
|||
{
|
||||
"files.associations": {
|
||||
"iosfwd": "cpp"
|
||||
"iostream": "cpp",
|
||||
"iomanip": "cpp",
|
||||
"ostream": "cpp",
|
||||
"array": "cpp",
|
||||
"atomic": "cpp",
|
||||
"*.tcc": "cpp",
|
||||
"bitset": "cpp",
|
||||
"cctype": "cpp",
|
||||
"cfenv": "cpp",
|
||||
"chrono": "cpp",
|
||||
"cinttypes": "cpp",
|
||||
"clocale": "cpp",
|
||||
"cmath": "cpp",
|
||||
"codecvt": "cpp",
|
||||
"complex": "cpp",
|
||||
"condition_variable": "cpp",
|
||||
"csetjmp": "cpp",
|
||||
"csignal": "cpp",
|
||||
"cstdarg": "cpp",
|
||||
"cstddef": "cpp",
|
||||
"cstdint": "cpp",
|
||||
"cstdio": "cpp",
|
||||
"cstdlib": "cpp",
|
||||
"cstring": "cpp",
|
||||
"ctime": "cpp",
|
||||
"cuchar": "cpp",
|
||||
"cwchar": "cpp",
|
||||
"cwctype": "cpp",
|
||||
"deque": "cpp",
|
||||
"forward_list": "cpp",
|
||||
"list": "cpp",
|
||||
"unordered_map": "cpp",
|
||||
"unordered_set": "cpp",
|
||||
"vector": "cpp",
|
||||
"exception": "cpp",
|
||||
"algorithm": "cpp",
|
||||
"functional": "cpp",
|
||||
"iterator": "cpp",
|
||||
"map": "cpp",
|
||||
"memory": "cpp",
|
||||
"memory_resource": "cpp",
|
||||
"numeric": "cpp",
|
||||
"optional": "cpp",
|
||||
"random": "cpp",
|
||||
"ratio": "cpp",
|
||||
"regex": "cpp",
|
||||
"set": "cpp",
|
||||
"string": "cpp",
|
||||
"string_view": "cpp",
|
||||
"system_error": "cpp",
|
||||
"tuple": "cpp",
|
||||
"type_traits": "cpp",
|
||||
"utility": "cpp",
|
||||
"fstream": "cpp",
|
||||
"future": "cpp",
|
||||
"initializer_list": "cpp",
|
||||
"iosfwd": "cpp",
|
||||
"istream": "cpp",
|
||||
"limits": "cpp",
|
||||
"mutex": "cpp",
|
||||
"new": "cpp",
|
||||
"scoped_allocator": "cpp",
|
||||
"shared_mutex": "cpp",
|
||||
"sstream": "cpp",
|
||||
"stdexcept": "cpp",
|
||||
"streambuf": "cpp",
|
||||
"thread": "cpp",
|
||||
"typeindex": "cpp",
|
||||
"typeinfo": "cpp",
|
||||
"valarray": "cpp"
|
||||
}
|
||||
}
|
43
guess.cpp
Normal file
43
guess.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int K[101];
|
||||
string charact[101][101];
|
||||
|
||||
int main() {
|
||||
ifstream cin("guess.in");
|
||||
ofstream cout("guess.out");
|
||||
|
||||
int N;
|
||||
cin >> N;
|
||||
|
||||
for (int i = 0; i < N; ++i) {
|
||||
string name;
|
||||
cin >> name;
|
||||
|
||||
cin >> K[i];
|
||||
for (int j = 0; j < K[i]; ++j) cin >> charact[i][j];
|
||||
}
|
||||
|
||||
int ans = 0;
|
||||
for (int a = 0; a < N; ++a) {
|
||||
for (int b = a + 1; b < N; ++b) {
|
||||
int cnt = 0; // a and b are the two animals
|
||||
|
||||
for (int i = 0; i < K[a]; ++i) {
|
||||
bool found = false;
|
||||
|
||||
// search for a's charact in b's characts
|
||||
for (int j = 0; j < K[b]; ++j) {
|
||||
if (charact[a][i] == charact[b][j]) found = true;
|
||||
}
|
||||
|
||||
if (found == true) ++cnt;
|
||||
}
|
||||
|
||||
ans = max(cnt + 1, ans);
|
||||
}
|
||||
}
|
||||
|
||||
cout << ans;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
public class lineup {
|
||||
|
||||
}
|
38
shell.cpp
Normal file
38
shell.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
ifstream cin("shell.in");
|
||||
ofstream cout("shell.out");
|
||||
|
||||
int N;
|
||||
cin >> N;
|
||||
|
||||
int a[101], b[101], g[101];
|
||||
for (int i = 0; i < N; ++i) {
|
||||
cin >> a[i] >> b[i] >> g[i];
|
||||
}
|
||||
|
||||
int ans = 0;
|
||||
|
||||
for (int start : { 1, 2, 3 }) {
|
||||
int pos = start;
|
||||
int cnt = 0;
|
||||
for (int i = 0; i < N; ++i) {
|
||||
if (pos == a[i]) {
|
||||
pos = b[i];
|
||||
}
|
||||
else if (pos == b[i]) {
|
||||
pos = a[i];
|
||||
}
|
||||
|
||||
if (pos == g[i]) {
|
||||
++cnt;
|
||||
}
|
||||
}
|
||||
|
||||
ans = max(cnt, ans);
|
||||
}
|
||||
|
||||
cout << ans;
|
||||
}
|
25
sleepy.cpp
Normal file
25
sleepy.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
ifstream cin("sleepy.in");
|
||||
ofstream cout("sleepy.out");
|
||||
|
||||
int N;
|
||||
cin >> N;
|
||||
|
||||
int p[101];
|
||||
for (int i = 0; i < N; ++i) cin >> p[i];
|
||||
|
||||
int ans = 1;
|
||||
for (int i = N - 2; i >= 0; --i) {
|
||||
if (p[i] < p[i + 1]) {
|
||||
++ans;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cout << N - ans;
|
||||
}
|
Reference in a new issue