aboutsummaryrefslogtreecommitdiff
path: root/store/works/life/chuanzhi-cup/contest
diff options
context:
space:
mode:
Diffstat (limited to 'store/works/life/chuanzhi-cup/contest')
-rw-r--r--store/works/life/chuanzhi-cup/contest/1.cpp22
-rw-r--r--store/works/life/chuanzhi-cup/contest/2.cpp28
-rw-r--r--store/works/life/chuanzhi-cup/contest/3.cpp46
-rw-r--r--store/works/life/chuanzhi-cup/contest/4.cpp48
4 files changed, 0 insertions, 144 deletions
diff --git a/store/works/life/chuanzhi-cup/contest/1.cpp b/store/works/life/chuanzhi-cup/contest/1.cpp
deleted file mode 100644
index 4a20d97..0000000
--- a/store/works/life/chuanzhi-cup/contest/1.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <cstdio>
-
-int main() {
- int n, v, m, a;
- std::scanf("%d%d%d%d", &n, &v, &m, &a);
-
- int money = 0;
-
- v -= a;
-
- for (int i = 0; i < n; i++) {
- if (i % m == 0) {
- v += a;
- }
-
- money += v;
- }
-
- std::printf("%d", money);
-
- return 0;
-} \ No newline at end of file
diff --git a/store/works/life/chuanzhi-cup/contest/2.cpp b/store/works/life/chuanzhi-cup/contest/2.cpp
deleted file mode 100644
index 358e7fc..0000000
--- a/store/works/life/chuanzhi-cup/contest/2.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <cmath>
-#include <cstdio>
-
-int main() {
- int x;
- std::scanf("%d", &x);
-
- double gpa;
-
- if (x >= 90)
- gpa = 4.0;
- else if (x >= 60) {
- gpa = (x - 50.0) / 10.0;
- } else {
- int s = std::floor(std::sqrt(x) * 10.0);
- if (s >= 90)
- gpa = 4.0;
- else if (s >= 60) {
- gpa = (s - 50.0) / 10.0;
- } else {
- gpa = 0;
- }
- }
-
- std::printf("%.1f", gpa);
-
- return 0;
-} \ No newline at end of file
diff --git a/store/works/life/chuanzhi-cup/contest/3.cpp b/store/works/life/chuanzhi-cup/contest/3.cpp
deleted file mode 100644
index 8f0769d..0000000
--- a/store/works/life/chuanzhi-cup/contest/3.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <cstdio>
-#include <set>
-
-struct V {
- V(int n, int t, int k) : n(n), t(t), k(k), c(t * k) {}
-
- int n;
- int t;
- int k;
- const int c;
-};
-
-struct C {
- bool operator()(const V &left, const V &right) const {
- if (left.c > right.c)
- return true;
- else if (left.c < right.c)
- return false;
- else if (left.t > right.t)
- return true;
- else if (left.t < right.t)
- return false;
- else if (left.n < right.n)
- return true;
- return false;
- }
-};
-
-int main() {
- std::set<V, C> data;
-
- int n;
- std::scanf("%d", &n);
-
- for (int i = 1; i <= n; i++) {
- int t, k;
- std::scanf("%d%d", &t, &k);
- data.insert(V{i, t, k});
- }
-
- for (const auto &v : data) {
- std::printf("%d ", v.n);
- }
-
- return 0;
-} \ No newline at end of file
diff --git a/store/works/life/chuanzhi-cup/contest/4.cpp b/store/works/life/chuanzhi-cup/contest/4.cpp
deleted file mode 100644
index da01a23..0000000
--- a/store/works/life/chuanzhi-cup/contest/4.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <algorithm>
-#include <cstdio>
-#include <iostream>
-#include <string>
-#include <vector>
-
-int main() {
- std::vector<std::string> 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;
-}