From d92125ed4dfd5b22422315ff8f8de49a85871225 Mon Sep 17 00:00:00 2001 From: yenru0 Date: Tue, 18 Mar 2025 22:04:37 +0900 Subject: [PATCH] complete 5597.cpp 15552.cpp 26156.kt --- zeta_cpp/completed/15552.cpp | 19 ++++++++++++++++ zeta_cpp/completed/5597.cpp | 18 +++++++++++++++ zeta_kotlin/completed/26156.kt | 40 ++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 zeta_cpp/completed/15552.cpp create mode 100644 zeta_cpp/completed/5597.cpp create mode 100644 zeta_kotlin/completed/26156.kt diff --git a/zeta_cpp/completed/15552.cpp b/zeta_cpp/completed/15552.cpp new file mode 100644 index 0000000..8835874 --- /dev/null +++ b/zeta_cpp/completed/15552.cpp @@ -0,0 +1,19 @@ +#include + +using namespace std; + +int main() { + + ios_base::sync_with_stdio(0); + cin.tie(nullptr); + int T; + int A, B; + std::cin >> T; + + for (int i = 0; i < T; i++) { + std::cin >> A >> B; + std::cout << A + B << '\n'; + } + + return 0; +} \ No newline at end of file diff --git a/zeta_cpp/completed/5597.cpp b/zeta_cpp/completed/5597.cpp new file mode 100644 index 0000000..14f8769 --- /dev/null +++ b/zeta_cpp/completed/5597.cpp @@ -0,0 +1,18 @@ +#include + +int main() { + int *arr = new int[30]{0}; + int index; + for (int i = 0; i < 30; i++) { + std::cin >> index; + arr[index - 1] = 1; + } + + for (int i = 0; i < 30; i++) { + if (!arr[i]) { + std::cout << i + 1 << std::endl; + } + } + + return 0; +} \ No newline at end of file diff --git a/zeta_kotlin/completed/26156.kt b/zeta_kotlin/completed/26156.kt new file mode 100644 index 0000000..faecded --- /dev/null +++ b/zeta_kotlin/completed/26156.kt @@ -0,0 +1,40 @@ +import kotlin.math.* + +class NarockSolver(val s: String) { + companion object { + val HAXIM: Int = 1000000007 + } + fun solve(): Int { + var cntR = 0 + var cntO = 0 + var cntC = 0 + var cntS = 0 + var rfront = 1 + for (v: Char in s) { + if (v == 'R') { + cntR += rfront + cntR %= HAXIM + } else if (v == 'O') { + cntO += cntR + cntO %= HAXIM + } else if (v == 'C') { + cntC += cntO + cntC %= HAXIM + } else if (v == 'K') { + cntS += cntC + cntS %= HAXIM + } + rfront *= 2 + rfront %= HAXIM + } + + return cntS + } +} + +fun main() { + readLine() + val s: String = readLine()!! + val solver = NarockSolver(s) + println(solver.solve()) +}