diff --git a/atcoder/ABC/TLE/abc230_c/.idea/.gitignore b/atcoder/ABC/TLE/abc230_c/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/atcoder/ABC/TLE/abc230_c/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/atcoder/ABC/TLE/abc230_c/.idea/libraries/KotlinJavaRuntime.xml b/atcoder/ABC/TLE/abc230_c/.idea/libraries/KotlinJavaRuntime.xml new file mode 100644 index 0000000..9fbfb0d --- /dev/null +++ b/atcoder/ABC/TLE/abc230_c/.idea/libraries/KotlinJavaRuntime.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_c/.idea/misc.xml b/atcoder/ABC/TLE/abc230_c/.idea/misc.xml new file mode 100644 index 0000000..07115cd --- /dev/null +++ b/atcoder/ABC/TLE/abc230_c/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_c/.idea/modules.xml b/atcoder/ABC/TLE/abc230_c/.idea/modules.xml new file mode 100644 index 0000000..0a86179 --- /dev/null +++ b/atcoder/ABC/TLE/abc230_c/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_c/.idea/vcs.xml b/atcoder/ABC/TLE/abc230_c/.idea/vcs.xml new file mode 100644 index 0000000..c2365ab --- /dev/null +++ b/atcoder/ABC/TLE/abc230_c/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_c/abc230_c.iml b/atcoder/ABC/TLE/abc230_c/abc230_c.iml new file mode 100644 index 0000000..245d342 --- /dev/null +++ b/atcoder/ABC/TLE/abc230_c/abc230_c.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_c/out/production/abc230_c/META-INF/abc230_c.kotlin_module b/atcoder/ABC/TLE/abc230_c/out/production/abc230_c/META-INF/abc230_c.kotlin_module new file mode 100644 index 0000000..3be8cd0 Binary files /dev/null and b/atcoder/ABC/TLE/abc230_c/out/production/abc230_c/META-INF/abc230_c.kotlin_module differ diff --git a/atcoder/ABC/TLE/abc230_c/src/main.kt b/atcoder/ABC/TLE/abc230_c/src/main.kt new file mode 100644 index 0000000..58cb44d --- /dev/null +++ b/atcoder/ABC/TLE/abc230_c/src/main.kt @@ -0,0 +1,60 @@ +import java.io.PrintWriter +import java.util.PriorityQueue +import kotlin.math.max +import kotlin.math.min + +fun next() = readLine()!! +fun nextLongList() = next().split(" ").map{ it.toLong() } + +@JvmField val _writer = PrintWriter(System.out, false) +fun main() { _writer.solve(); _writer.flush() } +fun PrintWriter.solve() { + val (n, a, b) = nextLongList() + + val (p, q, r, s) = nextLongList() + + val que = PriorityQueue>() {i1 : Pair, i2 : Pair -> + return@PriorityQueue if (i1.first == i2.first) { + (i1.second - i2.second).toInt() + } + else { + (i1.first - i2.first).toInt() + } + } + + var fmin = max(1 - a, 1 - b) + var fmax = min(n - a, n - b) + + val set = mutableSetOf>() + for (k in fmin..fmax) { + set.add(a + k to b + k) + } + + val smin = max(1 - a, b - n) + val smax = min(n - a, b - 1) + + for (k in smin..smax) { + set.add(a + k to b - k) + } + + for (i in set) { + if (i.first in p..q && + i.second in r..s) { + que.add(i) + } + } + + var tmp = que.poll() + for (i in p..q) { + for (j in r..s) { + if (tmp != null && i == tmp.first && j == tmp.second) { + print('#') + tmp = que.poll() + } + else { + print('.') + } + } + println() + } +} \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_e/.idea/.gitignore b/atcoder/ABC/TLE/abc230_e/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/atcoder/ABC/TLE/abc230_e/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/atcoder/ABC/TLE/abc230_e/.idea/libraries/KotlinJavaRuntime.xml b/atcoder/ABC/TLE/abc230_e/.idea/libraries/KotlinJavaRuntime.xml new file mode 100644 index 0000000..9fbfb0d --- /dev/null +++ b/atcoder/ABC/TLE/abc230_e/.idea/libraries/KotlinJavaRuntime.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_e/.idea/misc.xml b/atcoder/ABC/TLE/abc230_e/.idea/misc.xml new file mode 100644 index 0000000..07115cd --- /dev/null +++ b/atcoder/ABC/TLE/abc230_e/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_e/.idea/modules.xml b/atcoder/ABC/TLE/abc230_e/.idea/modules.xml new file mode 100644 index 0000000..314ca3a --- /dev/null +++ b/atcoder/ABC/TLE/abc230_e/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_e/.idea/vcs.xml b/atcoder/ABC/TLE/abc230_e/.idea/vcs.xml new file mode 100644 index 0000000..c2365ab --- /dev/null +++ b/atcoder/ABC/TLE/abc230_e/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_e/abc230_e.iml b/atcoder/ABC/TLE/abc230_e/abc230_e.iml new file mode 100644 index 0000000..245d342 --- /dev/null +++ b/atcoder/ABC/TLE/abc230_e/abc230_e.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/TLE/abc230_e/out/production/abc230_e/META-INF/abc230_e.kotlin_module b/atcoder/ABC/TLE/abc230_e/out/production/abc230_e/META-INF/abc230_e.kotlin_module new file mode 100644 index 0000000..3be8cd0 Binary files /dev/null and b/atcoder/ABC/TLE/abc230_e/out/production/abc230_e/META-INF/abc230_e.kotlin_module differ diff --git a/atcoder/ABC/TLE/abc230_e/src/main.kt b/atcoder/ABC/TLE/abc230_e/src/main.kt new file mode 100644 index 0000000..3765940 --- /dev/null +++ b/atcoder/ABC/TLE/abc230_e/src/main.kt @@ -0,0 +1,23 @@ +import java.io.PrintWriter +fun next() = readLine()!! +fun nextLong() = next().toLong() + +@JvmField val _writer = PrintWriter(System.out, false) +fun main() { _writer.solve(); _writer.flush() } +fun PrintWriter.solve() { + val n = nextLong() + + var sum = 0L + for (i in 1..n) { + val tmp = n / i + if (tmp != 1L) { + sum += tmp + } + else { + sum += (n - i + 1) + break + } + } + + println(sum) +} \ No newline at end of file diff --git a/atcoder/ABC/abc230_a/.idea/.gitignore b/atcoder/ABC/abc230_a/.idea/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/atcoder/ABC/abc230_a/.idea/libraries/KotlinJavaRuntime.xml b/atcoder/ABC/abc230_a/.idea/libraries/KotlinJavaRuntime.xml new file mode 100644 index 0000000..9fbfb0d --- /dev/null +++ b/atcoder/ABC/abc230_a/.idea/libraries/KotlinJavaRuntime.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_a/.idea/misc.xml b/atcoder/ABC/abc230_a/.idea/misc.xml new file mode 100644 index 0000000..07115cd --- /dev/null +++ b/atcoder/ABC/abc230_a/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_a/.idea/modules.xml b/atcoder/ABC/abc230_a/.idea/modules.xml new file mode 100644 index 0000000..c37267d --- /dev/null +++ b/atcoder/ABC/abc230_a/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_a/.idea/vcs.xml b/atcoder/ABC/abc230_a/.idea/vcs.xml new file mode 100644 index 0000000..c2365ab --- /dev/null +++ b/atcoder/ABC/abc230_a/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_a/.idea/workspace.xml b/atcoder/ABC/abc230_a/.idea/workspace.xml new file mode 100644 index 0000000..a131e02 --- /dev/null +++ b/atcoder/ABC/abc230_a/.idea/workspace.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1646614246022 + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_a/abc230_a.iml b/atcoder/ABC/abc230_a/abc230_a.iml new file mode 100644 index 0000000..245d342 --- /dev/null +++ b/atcoder/ABC/abc230_a/abc230_a.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_a/out/production/abc230_a/META-INF/abc230_a.kotlin_module b/atcoder/ABC/abc230_a/out/production/abc230_a/META-INF/abc230_a.kotlin_module new file mode 100644 index 0000000..3be8cd0 Binary files /dev/null and b/atcoder/ABC/abc230_a/out/production/abc230_a/META-INF/abc230_a.kotlin_module differ diff --git a/atcoder/ABC/abc230_a/src/main.kt b/atcoder/ABC/abc230_a/src/main.kt new file mode 100644 index 0000000..77620df --- /dev/null +++ b/atcoder/ABC/abc230_a/src/main.kt @@ -0,0 +1,11 @@ +import java.io.PrintWriter +fun next() = readLine()!! +fun nextInt() = next().toInt() + +@JvmField val _writer = PrintWriter(System.out, false) +fun main() { _writer.solve(); _writer.flush() } +fun PrintWriter.solve() { + val n = nextInt() + + println(if (n >= 42) "AGC" + "%03d".format(n + 1) else "AGC" + "%03d".format(n)) +} \ No newline at end of file diff --git a/atcoder/ABC/abc230_b/.idea/.gitignore b/atcoder/ABC/abc230_b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/atcoder/ABC/abc230_b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/atcoder/ABC/abc230_b/.idea/libraries/KotlinJavaRuntime.xml b/atcoder/ABC/abc230_b/.idea/libraries/KotlinJavaRuntime.xml new file mode 100644 index 0000000..9fbfb0d --- /dev/null +++ b/atcoder/ABC/abc230_b/.idea/libraries/KotlinJavaRuntime.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_b/.idea/misc.xml b/atcoder/ABC/abc230_b/.idea/misc.xml new file mode 100644 index 0000000..07115cd --- /dev/null +++ b/atcoder/ABC/abc230_b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_b/.idea/modules.xml b/atcoder/ABC/abc230_b/.idea/modules.xml new file mode 100644 index 0000000..9ab85f8 --- /dev/null +++ b/atcoder/ABC/abc230_b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_b/.idea/vcs.xml b/atcoder/ABC/abc230_b/.idea/vcs.xml new file mode 100644 index 0000000..c2365ab --- /dev/null +++ b/atcoder/ABC/abc230_b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_b/abc230_b.iml b/atcoder/ABC/abc230_b/abc230_b.iml new file mode 100644 index 0000000..245d342 --- /dev/null +++ b/atcoder/ABC/abc230_b/abc230_b.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/atcoder/ABC/abc230_b/out/production/abc230_b/META-INF/abc230_b.kotlin_module b/atcoder/ABC/abc230_b/out/production/abc230_b/META-INF/abc230_b.kotlin_module new file mode 100644 index 0000000..3be8cd0 Binary files /dev/null and b/atcoder/ABC/abc230_b/out/production/abc230_b/META-INF/abc230_b.kotlin_module differ diff --git a/atcoder/ABC/abc230_b/src/main.kt b/atcoder/ABC/abc230_b/src/main.kt new file mode 100644 index 0000000..224b6d6 --- /dev/null +++ b/atcoder/ABC/abc230_b/src/main.kt @@ -0,0 +1,34 @@ +import java.io.PrintWriter +fun next() = readLine()!! + +@JvmField val _writer = PrintWriter(System.out, false) +fun main() { _writer.solve(); _writer.flush() } +fun PrintWriter.solve() { + val s = next() + + var ans = true + var first = true + var cnt = 0 + for (i in s.indices) { + if (s[i] == 'x') { + cnt++ + + if (cnt > 2) { + ans = false + break + } + } + else { + if (((cnt == 0 || cnt == 1) && first) || cnt == 2) { + cnt = 0 + first = false + } + else { + ans = false + break + } + } + } + + println(if (ans) "Yes" else "No") +} \ No newline at end of file