From 1a3d46c357f7b3d14fc59334ef740c012162742a Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 3 Jan 2022 20:11:48 +0800 Subject: [PATCH] =?UTF-8?q?#1167.=20=E3=80=90=E6=A8=A1=E6=9D=BF=E3=80=91?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=BC=8F=E4=BA=A4=E4=BA=92=20/=20=E4=B8=80?= =?UTF-8?q?=E9=81=93=E5=BC=80=E4=B8=9A=E3=81=AE=E5=87=BD=E6=95=B0=E5=BC=8F?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://sjzezoj.com/submission/46420 --- S2OJ/1167/1167.cpp | 7 +++++++ S2OJ/1167/head.h | 1 + S2OJ/1167/implementer.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 S2OJ/1167/1167.cpp create mode 100644 S2OJ/1167/head.h create mode 100644 S2OJ/1167/implementer.cpp diff --git a/S2OJ/1167/1167.cpp b/S2OJ/1167/1167.cpp new file mode 100644 index 00000000..4e64e957 --- /dev/null +++ b/S2OJ/1167/1167.cpp @@ -0,0 +1,7 @@ +// Compile command: g++ implementer.cpp 1167.cpp -o 1167 -O2 -lm + +#include "head.h" + +unsigned solv(unsigned a, unsigned b) { + return a * b; +} diff --git a/S2OJ/1167/head.h b/S2OJ/1167/head.h new file mode 100644 index 00000000..dcd7b934 --- /dev/null +++ b/S2OJ/1167/head.h @@ -0,0 +1 @@ +unsigned int solv(unsigned int, unsigned int); diff --git a/S2OJ/1167/implementer.cpp b/S2OJ/1167/implementer.cpp new file mode 100644 index 00000000..9815c20d --- /dev/null +++ b/S2OJ/1167/implementer.cpp @@ -0,0 +1,24 @@ +#include + +#include "head.h" + +static inline unsigned int randnum() { + static unsigned int seed = time(nullptr); + return seed ^= seed << 5, seed ^= seed >> 7, seed ^= seed << 13; +} + +std::string str = "1145141919810efghkkk"; + +signed main() { + int n; + std::cin >> n; + unsigned int ps = (randnum() % str.length()); + if (!ps) ++ps; + std::cout << str.substr(0, ps); + for (int i = 1; i <= n; ++i) { + unsigned int a = randnum(), b = randnum(); + unsigned int ret = solv(a, b); + if (i == 1) std::cout << str.substr(ps) << '\n'; + std::cout << a * b << ' ' << ret << '\n'; + } +}