From 2a47d3c445ab315e2c25252d7e2bb3fcc67cd5cd Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Wed, 25 Jan 2023 16:33:11 +0800 Subject: [PATCH] E - Omkar and Duck https://codeforces.com/contest/1392/submission/190463285 --- Codeforces/1392/E/E.cpp | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Codeforces/1392/E/E.cpp diff --git a/Codeforces/1392/E/E.cpp b/Codeforces/1392/E/E.cpp new file mode 100644 index 00000000..64fa3847 --- /dev/null +++ b/Codeforces/1392/E/E.cpp @@ -0,0 +1,47 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +const int N = 30; + +int n, q; +long long a[N][N]; + +int main() { + std::ios::sync_with_stdio(false); + + cin >> n; + + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + cout << ((i & 1ll) << (i + j)) << ' '; + } + + cout << endl; + } + + cout << std::flush; + + cin >> q; + + while (q--) { + long long x; + + cin >> x; + + int xx = 0, yy = 0; + + cout << 1 << ' ' << 1 << endl; + + for (int i = 1; i <= n * 2 - 2; i++) { + if (((x >> i) & 1) == (xx & 1)) yy++; + else xx++; + + cout << xx + 1 << ' ' << yy + 1 << endl; + } + + cout << std::flush; + } +}