diff --git a/Hydro/system_test/1/1.cpp b/Hydro/system_test/1/1.cpp new file mode 100644 index 00000000..9172e347 --- /dev/null +++ b/Hydro/system_test/1/1.cpp @@ -0,0 +1,22 @@ +#include "coin.h" + +using std::cin; +using std::cout; +using std::endl; + +int n, c[105], ans; + +int main() { + n = getn(); + for (int i = 1; i <= n; i++) { + for (int j = 1; j <= 1000; j++) { + c[i] += !!query(i); + } + } + ans = 1; + for (int i = 2; i <= n; i++) { + if (c[i] <= c[ans]) ans = i; + } + submit(ans); + return 0; +} diff --git a/Hydro/system_test/1/coin.h b/Hydro/system_test/1/coin.h new file mode 100644 index 00000000..e8bc5503 --- /dev/null +++ b/Hydro/system_test/1/coin.h @@ -0,0 +1,44 @@ +#include +using namespace std; + +namespace erwqergdczxv { + static int n, m, cnt; + static bool hasUsedGetN = false; + static bool hasSubmitted = false; + + void RE() { + puts("re"); + exit(0); + } + + int getn() { + if (hasUsedGetN) RE(); + cin >> n; + hasUsedGetN = 1; + m = rand() % n + 1; + return n; + } + + int query(int x) { + if (!hasUsedGetN || hasSubmitted) RE(); + cnt++; + if (cnt > 100000) RE(); + if (x == m) + return (rand() % 10 <= 3); + else + return (rand() % 10 <= 4); + } + + void submit(int x) { + if (hasSubmitted) RE(); + if (x == m) + puts("ok"); + else + puts("wa"); + hasSubmitted = 1; + } +} // namespace erwqergdczxv + +using erwqergdczxv::getn; +using erwqergdczxv::query; +using erwqergdczxv::submit; diff --git a/Hydro/system_test/1/data/coin.h b/Hydro/system_test/1/data/coin.h new file mode 100644 index 00000000..60ace0df --- /dev/null +++ b/Hydro/system_test/1/data/coin.h @@ -0,0 +1,45 @@ +#include + +using namespace std; + +namespace ahfiuasykjbvzkw { + static int n, m, cnt; + static bool hasUsedGetN = false; + static bool hasSubmitted = false; + + void RE() { + puts("re"); + exit(0); + } + + int getn() { + if (hasUsedGetN) RE(); + cin >> n; + hasUsedGetN = 1; + m = rand() % n + 1; + return n; + } + + int query(int x) { + if (!hasUsedGetN || hasSubmitted) RE(); + cnt++; + if (cnt > 100000) RE(); + if (x == m) + return (rand() % 10 <= 3); + else + return (rand() % 10 <= 4); + } + + void submit(int x) { + if (hasSubmitted) RE(); + if (x == m) + puts("ok532124524657743124323"); + else + puts("wa"); + hasSubmitted = 1; + } +} // namespace ahfiuasykjbvzkw + +using ahfiuasykjbvzkw::getn; +using ahfiuasykjbvzkw::query; +using ahfiuasykjbvzkw::submit; diff --git a/Hydro/system_test/1/data/config.yaml b/Hydro/system_test/1/data/config.yaml new file mode 100644 index 00000000..70d0df1c --- /dev/null +++ b/Hydro/system_test/1/data/config.yaml @@ -0,0 +1,24 @@ +type: default + +filename: null + +checker_type: testlib +checker: spj.cc + +user_extra_files: + - coin.h + +time: 100ms +memory: 256m + +cases: + - input: data1.in + - input: data2.in + - input: data3.in + - input: data4.in + - input: data5.in + - input: data6.in + - input: data7.in + - input: data8.in + - input: data9.in + - input: data10.in diff --git a/Hydro/system_test/1/data/data1.in b/Hydro/system_test/1/data/data1.in new file mode 100644 index 00000000..65493889 --- /dev/null +++ b/Hydro/system_test/1/data/data1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:084c799cd551dd1d8d5c5f9a5d593b2e931f5e36122ee5c793c1d08a19839cc0 +size 3 diff --git a/Hydro/system_test/1/data/data10.in b/Hydro/system_test/1/data/data10.in new file mode 100644 index 00000000..0f1450c8 --- /dev/null +++ b/Hydro/system_test/1/data/data10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:979b894f2d91bf199766571d58024f020d1a44a417da5f48e1fa1cdf554a14f5 +size 3 diff --git a/Hydro/system_test/1/data/data2.in b/Hydro/system_test/1/data/data2.in new file mode 100644 index 00000000..ea2a097b --- /dev/null +++ b/Hydro/system_test/1/data/data2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89e56b272669de11431602f3c77e560ecf6c61512fa8db5ac0006606e88d5282 +size 3 diff --git a/Hydro/system_test/1/data/data3.in b/Hydro/system_test/1/data/data3.in new file mode 100644 index 00000000..d2bb1a39 --- /dev/null +++ b/Hydro/system_test/1/data/data3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90d7ec0f0acef104d8b6252794295f661a0149634868d02a1ae0c358099638f5 +size 3 diff --git a/Hydro/system_test/1/data/data4.in b/Hydro/system_test/1/data/data4.in new file mode 100644 index 00000000..1afab5f7 --- /dev/null +++ b/Hydro/system_test/1/data/data4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865 +size 2 diff --git a/Hydro/system_test/1/data/data5.in b/Hydro/system_test/1/data/data5.in new file mode 100644 index 00000000..87dfeb54 --- /dev/null +++ b/Hydro/system_test/1/data/data5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6442bc26a7c562f5afe6467dab36365c709909f6a81afcecfc0c25cff0f1bab0 +size 3 diff --git a/Hydro/system_test/1/data/data6.in b/Hydro/system_test/1/data/data6.in new file mode 100644 index 00000000..e1418f76 --- /dev/null +++ b/Hydro/system_test/1/data/data6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64aeb9975f234becd55bb4635e6e2f2da7a6b7bf0a896f0c07763bdfbfb31420 +size 3 diff --git a/Hydro/system_test/1/data/data7.in b/Hydro/system_test/1/data/data7.in new file mode 100644 index 00000000..b5ce5329 --- /dev/null +++ b/Hydro/system_test/1/data/data7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ced0deaf966775a8b592f6bd95a33a67053b242a7c13654896cd9f2d36a0e37 +size 3 diff --git a/Hydro/system_test/1/data/data8.in b/Hydro/system_test/1/data/data8.in new file mode 100644 index 00000000..38c32322 --- /dev/null +++ b/Hydro/system_test/1/data/data8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be4ba010e48e7d5c7c60457e7f40538407a26f4ead94b392beff67a3a5546b8a +size 3 diff --git a/Hydro/system_test/1/data/data9.in b/Hydro/system_test/1/data/data9.in new file mode 100644 index 00000000..2e2199de --- /dev/null +++ b/Hydro/system_test/1/data/data9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eecd262c3ecab667b61ebb70835f3b181a1d1530d3ebc0ef99a3a8dc3d5b193f +size 3 diff --git a/Hydro/system_test/1/data/spj.cc b/Hydro/system_test/1/data/spj.cc new file mode 100644 index 00000000..597d5cde --- /dev/null +++ b/Hydro/system_test/1/data/spj.cc @@ -0,0 +1,21 @@ +/** + * @file spj.cc + * @author Macesuted Kysic + * @date 2021-02-04 + * + * @copyright Copyright (c) 2021 + * + */ + +#include + +#include "testlib.h" + +int main(int argc, char* argv[]) { + registerTestlibCmd(argc, argv); + std::string s = ouf.readToken(); + if (s == "ok532124524657743124323") + quitf(_ok, "Correct"); + else + quitf(_wa, "Wrong Answer"); +}