diff --git a/contest/38793/T160507/T160507.cpp b/contest/38793/T160507/T160507.cpp new file mode 100644 index 00000000..18725db7 --- /dev/null +++ b/contest/38793/T160507/T160507.cpp @@ -0,0 +1,14 @@ +#include + +using namespace std; + +int main() { + int n, m, v, a, ans = 0; + cin >> n >> v >> m >> a; + for (int i = 1; i <= n; i++) { + ans += v; + if (i % m == 0) v += a; + } + cout << ans << endl; + return 0; +} diff --git a/contest/38793/T160508/T160508.cpp b/contest/38793/T160508/T160508.cpp new file mode 100644 index 00000000..7cc4901e --- /dev/null +++ b/contest/38793/T160508/T160508.cpp @@ -0,0 +1,28 @@ +#include + +using namespace std; + +int main() { + int score; + double gpa = 0.0; + cin >> score; + if (score >= 90) { + gpa = 4.0; + } + else if (60 <= score && score <= 89) { + gpa = 4.0 - (90 - score) * 0.1; + } + else { + if (floor(sqrt(score) * 10.0) >= 90.0) { + gpa = 4.0; + } + else if (floor(sqrt(score) * 10.0) >= 60.0) { + gpa = 4.0 - (90.0 - floor(sqrt(score) * 10.0)) * 0.1; + } + else { + gpa = 0.0; + } + } + cout << fixed << setprecision(1) << gpa << endl; + return 0; +} diff --git a/contest/38793/T160509/T160509.cpp b/contest/38793/T160509/T160509.cpp new file mode 100644 index 00000000..8f12cde8 --- /dev/null +++ b/contest/38793/T160509/T160509.cpp @@ -0,0 +1,26 @@ +#include + +using namespace std; + +struct node { + int i, t, k; +} p[500005]; + +bool cmp(node a, node b) { + return a.t * a.k == b.t * b.k ? a.t == b.t ? a.i < b.i : a.t > b.t : a.t * a.k > b.t * b.k; +} + +int main() { + int n; + cin >> n; + for (int i = 1; i <= n; i++) { + cin >> p[i].t >> p[i].k; + p[i].i = i; + } + sort(p + 1, p + 1 + n, cmp); + for (int i = 1; i <= n; i++) { + cout << p[i].i << ' '; + } + cout << endl; + return 0; +}