|
| 1 | +/** |
| 2 | + * @file 14559.cpp |
| 3 | + * @author Macesuted ([email protected]) |
| 4 | + * @date 2025-09-06 |
| 5 | + * |
| 6 | + * @copyright Copyright (c) 2025 |
| 7 | + * |
| 8 | + */ |
| 9 | + |
| 10 | +#include <bits/stdc++.h> |
| 11 | +using namespace std; |
| 12 | + |
| 13 | +#define endl '\n' |
| 14 | + |
| 15 | +using tiii = tuple<int, int, int>; |
| 16 | + |
| 17 | +void printx(const string& s, const vector<tiii>& rec) { |
| 18 | + cout << s << ' ' << rec.size() << endl; |
| 19 | + for (auto [x, y, z] : rec) cout << x << ' '; |
| 20 | + cout << endl; |
| 21 | + for (auto [x, y, z] : rec) cout << y << ' '; |
| 22 | + cout << endl; |
| 23 | + for (auto [x, y, z] : rec) cout << z << ' '; |
| 24 | + cout << endl; |
| 25 | + return; |
| 26 | +} |
| 27 | + |
| 28 | +void makePre(string cmd, int l, int r) { |
| 29 | + for (int i = 1; i < 32; i++) { |
| 30 | + vector<tiii> rec; |
| 31 | + for (int x = l + i; x <= r; x += 32) rec.emplace_back(x - 1, x, x); |
| 32 | + printx(cmd, rec); |
| 33 | + } |
| 34 | + for (int i = l + 32; i <= r; i += 32) { |
| 35 | + vector<tiii> rec; |
| 36 | + for (int j = i; j < i + 32; j++) rec.emplace_back(i - 1, j, j); |
| 37 | + printx(cmd, rec); |
| 38 | + } |
| 39 | + return; |
| 40 | +} |
| 41 | + |
| 42 | +void solve(void) { |
| 43 | + cout << 188 << endl; |
| 44 | + |
| 45 | + makePre("add", 0, 1023); |
| 46 | + |
| 47 | + vector<tiii> rec; |
| 48 | + for (int i = 0; i < 1024; i++) { |
| 49 | + rec.emplace_back(i, i | (1 << 10), i | (1 << 10)); |
| 50 | + if (rec.size() == 32) printx("mul", rec), rec.clear(); |
| 51 | + } |
| 52 | + |
| 53 | + makePre("max", 1024, 2047); |
| 54 | + |
| 55 | + for (int i = 0; i < 1024; i++) { |
| 56 | + rec.emplace_back(i, i | (1 << 10), i); |
| 57 | + if (rec.size() == 32) printx("sub", rec), rec.clear(); |
| 58 | + } |
| 59 | + |
| 60 | + return; |
| 61 | +} |
| 62 | + |
| 63 | +int main() { |
| 64 | + ios::sync_with_stdio(false), cin.tie(nullptr); |
| 65 | + |
| 66 | + int _ = 1; |
| 67 | + while (_--) solve(); |
| 68 | + |
| 69 | + return 0; |
| 70 | +} |
0 commit comments