Skip to content

Commit b6a5db2

Browse files
committed
atcoder
1 parent 9d5045d commit b6a5db2

File tree

87 files changed

+2103
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+2103
-124
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
2+
*
3+
!*/
4+
!*.*
15
*.dSYM

.vscode/launch.json

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
{
2-
// IntelliSense を使用して利用可能な属性を学べます。
3-
// 既存の属性の説明をホバーして表示します。
4-
// 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"name": "clang++ - Build and debug active file",
9-
"type": "cppdbg",
10-
"request": "launch",
11-
"program": "${fileDirname}/${fileBasenameNoExtension}",
12-
"args": [],
13-
"stopAtEntry": true,
14-
"cwd": "${workspaceFolder}",
15-
"environment": [],
16-
"externalConsole": false,
17-
"MIMode": "lldb",
18-
//"preLaunchTask": "C/C++: clang++ アクティブなファイルのビルド"
19-
"preLaunchTask": "clang++ build active file"
20-
}
21-
]
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "clang++ - Build and debug active file",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"program": "${fileDirname}/${fileBasenameNoExtension}",
9+
"args": [],
10+
"stopAtEntry": true,
11+
"cwd": "${workspaceFolder}",
12+
"environment": [],
13+
"externalConsole": true,
14+
"MIMode": "lldb",
15+
"preLaunchTask": "clang++ build active file"
16+
},
17+
{
18+
"name": "C/C++: clang++ アクティブ ファイルのビルドとデバッグ",
19+
"type": "cppdbg",
20+
"request": "launch",
21+
"program": "${fileDirname}/${fileBasenameNoExtension}",
22+
"args": [],
23+
"stopAtEntry": false,
24+
"cwd": "${fileDirname}",
25+
"environment": [],
26+
"externalConsole": false,
27+
"MIMode": "lldb",
28+
"preLaunchTask": "C/C++: clang++ アクティブなファイルのビルド"
29+
}
30+
]
2231
}

.vscode/settings.json

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,82 @@
11
{
22
"files.associations": {
33
"*.erb": "html.erb",
4+
"*.txt": "txt",
5+
"*.html": "html",
6+
"**/templates/**/*.html": "django-html",
7+
"*.mdx": "markdown",
8+
"**/styles/*.css": "css",
49
"vector": "cpp",
510
"ostream": "cpp",
611
"iterator": "cpp",
712
"algorithm": "cpp",
8-
"iostream": "cpp"
13+
"iostream": "cpp",
14+
"__bit_reference": "cpp",
15+
"__config": "cpp",
16+
"__debug": "cpp",
17+
"__errc": "cpp",
18+
"__functional_base": "cpp",
19+
"__hash_table": "cpp",
20+
"__locale": "cpp",
21+
"__mutex_base": "cpp",
22+
"__node_handle": "cpp",
23+
"__nullptr": "cpp",
24+
"__split_buffer": "cpp",
25+
"__string": "cpp",
26+
"__threading_support": "cpp",
27+
"__tuple": "cpp",
28+
"array": "cpp",
29+
"atomic": "cpp",
30+
"bit": "cpp",
31+
"bitset": "cpp",
32+
"cctype": "cpp",
33+
"chrono": "cpp",
34+
"clocale": "cpp",
35+
"cmath": "cpp",
36+
"complex": "cpp",
37+
"cstdarg": "cpp",
38+
"cstddef": "cpp",
39+
"cstdint": "cpp",
40+
"cstdio": "cpp",
41+
"cstdlib": "cpp",
42+
"cstring": "cpp",
43+
"ctime": "cpp",
44+
"cwchar": "cpp",
45+
"cwctype": "cpp",
46+
"exception": "cpp",
47+
"functional": "cpp",
48+
"initializer_list": "cpp",
49+
"ios": "cpp",
50+
"iosfwd": "cpp",
51+
"istream": "cpp",
52+
"limits": "cpp",
53+
"locale": "cpp",
54+
"memory": "cpp",
55+
"mutex": "cpp",
56+
"new": "cpp",
57+
"numeric": "cpp",
58+
"optional": "cpp",
59+
"ratio": "cpp",
60+
"sstream": "cpp",
61+
"stdexcept": "cpp",
62+
"streambuf": "cpp",
63+
"string": "cpp",
64+
"string_view": "cpp",
65+
"system_error": "cpp",
66+
"tuple": "cpp",
67+
"type_traits": "cpp",
68+
"typeinfo": "cpp",
69+
"unordered_map": "cpp",
70+
"utility": "cpp",
71+
"deque": "cpp",
72+
"regex": "cpp",
73+
"__bits": "cpp",
74+
"__tree": "cpp",
75+
"compare": "cpp",
76+
"concepts": "cpp",
77+
"iomanip": "cpp",
78+
"map": "cpp",
79+
"queue": "cpp",
80+
"variant": "cpp"
981
}
10-
}
82+
}

.vscode/tasks.json

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,49 @@
11
{
2-
"version": "2.0.0",
3-
"tasks": [
4-
{
5-
"type": "shell",
6-
"label": "clang++ build active file",
7-
"command": "/usr/bin/clang++",
8-
"args": [
9-
"-std=c++17",
10-
"-stdlib=libc++",
11-
"-g",
12-
"${file}",
13-
"-o",
14-
"${fileDirname}/${fileBasenameNoExtension}",
15-
//"--debug"
16-
],
17-
"options": {
18-
"cwd": "${workspaceFolder}"
19-
},
20-
"problemMatcher": ["$gcc"],
21-
"group": {
22-
"kind": "build",
23-
"isDefault": true
24-
}
25-
}
26-
]
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "shell",
6+
"label": "clang++ build active file",
7+
"command": "/usr/bin/clang++",
8+
"args": [
9+
"-std=c++17",
10+
"-stdlib=libc++",
11+
"-g",
12+
"${file}",
13+
"-I/usr/local/include",
14+
"-o",
15+
"${fileDirname}/${fileBasenameNoExtension}"
16+
],
17+
"options": {
18+
"cwd": "${workspaceFolder}"
19+
},
20+
"problemMatcher": [
21+
"$gcc"
22+
],
23+
"group": {
24+
"kind": "build",
25+
"isDefault": true
26+
}
27+
},
28+
{
29+
"type": "cppbuild",
30+
"label": "C/C++: clang++ アクティブなファイルのビルド",
31+
"command": "/usr/bin/clang++",
32+
"args": [
33+
"-fdiagnostics-color=always",
34+
"-g",
35+
"${file}",
36+
"-o",
37+
"${fileDirname}/${fileBasenameNoExtension}"
38+
],
39+
"options": {
40+
"cwd": "${fileDirname}"
41+
},
42+
"problemMatcher": [
43+
"$gcc"
44+
],
45+
"group": "build",
46+
"detail": "デバッガーによって生成されたタスク。"
47+
}
48+
]
2749
}

20210424/a-squareinequality.cpp

Whitespace-only changes.

20210424/b-intersection.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include <iostream>
2+
#include <vector>
3+
#include <algorithm>
4+
5+
int main()
6+
{
7+
int N;
8+
std::cin >> N;
9+
std::vector<int> A(N), B(N);
10+
11+
for (auto &x : A)
12+
{
13+
std::cin >> x;
14+
}
15+
for (auto &x : B)
16+
{
17+
std::cin >> x;
18+
}
19+
20+
auto max_a = *std::max_element(A.begin(), A.end());
21+
auto min_b = *std::min_element(B.begin(), B.end());
22+
23+
if (max_a <= min_b)
24+
{
25+
std::cout << min_b - max_a + 1 << std::endl;
26+
}
27+
else
28+
{
29+
std::cout << 0 << std::endl;
30+
}
31+
}

20210424/c-ipel.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#include <iostream>
2+
#include <string>
3+
4+
int main()
5+
{
6+
int N, Q;
7+
std::string S;
8+
std::cin >> N >> S >> Q;
9+
bool flipped = false;
10+
for (int i = 0; i < Q; i++)
11+
{
12+
unsigned int T, A, B;
13+
std::cin >> T >> A >> B;
14+
if (T == 1)
15+
{
16+
if (flipped)
17+
{
18+
A = (A <= N) ? (A + N) : (A - N);
19+
B = (B <= N) ? (B + N) : (B - N);
20+
}
21+
char tmp = S[A - 1];
22+
S[A - 1] = S[B - 1];
23+
S[B - 1] = tmp;
24+
}
25+
else
26+
{
27+
flipped = !flipped;
28+
}
29+
}
30+
31+
if (flipped)
32+
{
33+
S = S.substr(N) + S.substr(0, N);
34+
}
35+
std::cout << S << std::endl;
36+
}

20210501/a-ufo.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <iostream>
2+
#include <string>
3+
#include <iterator>
4+
#include <regex>
5+
6+
int main()
7+
{
8+
std::string S;
9+
std::cin >> S;
10+
std::regex re(R"(ZONe)");
11+
12+
for (std::sregex_iterator it(S.begin(), S.end(), re), end; it != end; ++it)
13+
{
14+
auto &&m = *it;
15+
std::cout << m.position() << std::endl;
16+
}
17+
}

20210508/a-century.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <iostream>
2+
3+
int main()
4+
{
5+
int N;
6+
std::cin >> N;
7+
std::cout << (N - 1) / 100 + 1 << std::endl;
8+
}

20210508/b-200th.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <iostream>
2+
3+
int main()
4+
{
5+
long long int N;
6+
int K;
7+
std::cin >> N >> K;
8+
for (int i = 0; i < K; i++)
9+
{
10+
if (N % 200 == 0)
11+
{
12+
N /= 200;
13+
}
14+
else
15+
{
16+
N *= 1000;
17+
N += 200;
18+
}
19+
}
20+
std::cout << N << std::endl;
21+
}

0 commit comments

Comments
 (0)