From 93c452fdfa2c331458419b0ff875d9523d0f336f Mon Sep 17 00:00:00 2001 From: Philippe Zwietering Date: Tue, 7 Dec 2021 00:43:31 +0100 Subject: [PATCH] Started with Codeforces educational round 118, finished a and b --- codeforces/educational_rounds/118/a.cpp | 61 +++++++++++++++++++++++++ codeforces/educational_rounds/118/b.cpp | 39 ++++++++++++++++ codeforces/educational_rounds/118/c.cpp | 25 ++++++++++ codeforces/educational_rounds/118/d.cpp | 25 ++++++++++ codeforces/educational_rounds/118/e.cpp | 25 ++++++++++ codeforces/educational_rounds/118/f.cpp | 25 ++++++++++ 6 files changed, 200 insertions(+) create mode 100644 codeforces/educational_rounds/118/a.cpp create mode 100644 codeforces/educational_rounds/118/b.cpp create mode 100644 codeforces/educational_rounds/118/c.cpp create mode 100644 codeforces/educational_rounds/118/d.cpp create mode 100644 codeforces/educational_rounds/118/e.cpp create mode 100644 codeforces/educational_rounds/118/f.cpp diff --git a/codeforces/educational_rounds/118/a.cpp b/codeforces/educational_rounds/118/a.cpp new file mode 100644 index 0000000..c1f0ec0 --- /dev/null +++ b/codeforces/educational_rounds/118/a.cpp @@ -0,0 +1,61 @@ +#include + +using namespace std; + +void test_case(int tc){ + int x, y, xZeroes, yZeroes; + cin >> x >> xZeroes >> y >> yZeroes; + + int xLength = log10(x) + 1 + xZeroes; + int yLength = log10(y) + 1 + yZeroes; + + if(xLength > yLength){ + cout << ">\n"; + return; + } else if(xLength < yLength){ + cout << "<\n"; + return; + } + + int minZeroes = min(xZeroes, yZeroes); + xZeroes -= minZeroes; + yZeroes -= minZeroes; + + double dx, dy; + + if(x > y){ + dx = (double)x / pow(10, yZeroes); + dy = y; + } else{ + dx = x; + dy = (double)y / pow(10, xZeroes); + } + + if(dx > dy){ + cout << ">"; + } else if(dx < dy){ + cout << "<"; + } else{ + cout << "="; + } cout << "\n"; + + return; +} + + + +int main(){ + ios::sync_with_stdio(0); + cin.tie(0); + + int t; + cin >> t; + + for(int tc = 1; tc <= t; ++tc){ + test_case(tc); + } + + cout << flush; + + return 0; +} \ No newline at end of file diff --git a/codeforces/educational_rounds/118/b.cpp b/codeforces/educational_rounds/118/b.cpp new file mode 100644 index 0000000..a2fdf8c --- /dev/null +++ b/codeforces/educational_rounds/118/b.cpp @@ -0,0 +1,39 @@ +#include + +using namespace std; + +void test_case(int tc){ + int n; + cin >> n; + + vector seq(n); + + for(int i = 0; i < n; ++i){ + cin >> seq[i]; + } + + sort(seq.begin(), seq.end()); + + for(int i = 1; i < n / 2 + 1; ++i){ + cout << seq[i] << " " << seq[0] << "\n"; + } + +} + + + +int main(){ + ios::sync_with_stdio(0); + cin.tie(0); + + int t; + cin >> t; + + for(int tc = 1; tc <= t; ++tc){ + test_case(tc); + } + + cout << flush; + + return 0; +} \ No newline at end of file diff --git a/codeforces/educational_rounds/118/c.cpp b/codeforces/educational_rounds/118/c.cpp new file mode 100644 index 0000000..0c03bec --- /dev/null +++ b/codeforces/educational_rounds/118/c.cpp @@ -0,0 +1,25 @@ +#include + +using namespace std; + +void test_case(int tc){ + +} + + + +int main(){ + ios::sync_with_stdio(0); + cin.tie(0); + + int t; + cin >> t; + + for(int tc = 1; tc <= t; ++tc){ + test_case(tc); + } + + cout << flush; + + return 0; +} \ No newline at end of file diff --git a/codeforces/educational_rounds/118/d.cpp b/codeforces/educational_rounds/118/d.cpp new file mode 100644 index 0000000..0c03bec --- /dev/null +++ b/codeforces/educational_rounds/118/d.cpp @@ -0,0 +1,25 @@ +#include + +using namespace std; + +void test_case(int tc){ + +} + + + +int main(){ + ios::sync_with_stdio(0); + cin.tie(0); + + int t; + cin >> t; + + for(int tc = 1; tc <= t; ++tc){ + test_case(tc); + } + + cout << flush; + + return 0; +} \ No newline at end of file diff --git a/codeforces/educational_rounds/118/e.cpp b/codeforces/educational_rounds/118/e.cpp new file mode 100644 index 0000000..0c03bec --- /dev/null +++ b/codeforces/educational_rounds/118/e.cpp @@ -0,0 +1,25 @@ +#include + +using namespace std; + +void test_case(int tc){ + +} + + + +int main(){ + ios::sync_with_stdio(0); + cin.tie(0); + + int t; + cin >> t; + + for(int tc = 1; tc <= t; ++tc){ + test_case(tc); + } + + cout << flush; + + return 0; +} \ No newline at end of file diff --git a/codeforces/educational_rounds/118/f.cpp b/codeforces/educational_rounds/118/f.cpp new file mode 100644 index 0000000..0c03bec --- /dev/null +++ b/codeforces/educational_rounds/118/f.cpp @@ -0,0 +1,25 @@ +#include + +using namespace std; + +void test_case(int tc){ + +} + + + +int main(){ + ios::sync_with_stdio(0); + cin.tie(0); + + int t; + cin >> t; + + for(int tc = 1; tc <= t; ++tc){ + test_case(tc); + } + + cout << flush; + + return 0; +} \ No newline at end of file