From dc1f0c4c0096013799416664894c5194dc7e1f52 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Fri, 28 Feb 2025 23:13:39 +0800 Subject: chore(store): move everything to store. --- works/life/chuanzhi-cup/contest/4.cpp | 48 ----------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 works/life/chuanzhi-cup/contest/4.cpp (limited to 'works/life/chuanzhi-cup/contest/4.cpp') diff --git a/works/life/chuanzhi-cup/contest/4.cpp b/works/life/chuanzhi-cup/contest/4.cpp deleted file mode 100644 index da01a23..0000000 --- a/works/life/chuanzhi-cup/contest/4.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include -#include -#include -#include - -int main() { - std::vector files; - int n; - std::cin >> n; - int current_count = 0; - while (current_count < n) { - std::string command; - std::cin >> command; - char a = command[0]; - if (a == 't') { - std::string file; - std::cin >> file; - auto iter = std::find(files.cbegin(), files.cend(), file); - if (iter == files.cend()) { - files.push_back(std::move(file)); - } - } else if (a == 'l') { - for (const auto &f : files) { - std::cout << f << '\n'; - } - } else { - char b = command[1]; - if (b == 'm') { - std::string file; - auto iter = std::find(files.cbegin(), files.cend(), file); - if (iter != files.cend()) - files.erase(iter); - } else { - std::string old, new_f; - std::cin >> old >> new_f; - auto iter = std::find(files.begin(), files.end(), old); - auto iter2 = std::find(files.begin(), files.end(), new_f); - if (iter != files.end() && iter2 == files.end()) { - *iter = std::move(new_f); - } - } - } - current_count++; - } - - return 0; -} -- cgit v1.2.3