QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#123786 | #5176. 多控制反转 | pandapythoner# | 0 | 0ms | 3644kb | C++14 | 1.5kb | 2023-07-13 17:08:10 | 2024-07-04 00:37:39 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define flt double
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#ifdef LOCAL
#define _GLIBCXX_DEBUG
bool local = true;
#else
bool local = false;
#endif
mt19937 rnd(234);
const ll inf = 1e18;
struct operation{
int t, x, y, z;
operation(){}
operation(int t, int x, int y, int z) : t(t), x(x), y(y), z(z) {}
};
ostream& operator<<(ostream &out, operation &op){
out << op.t << " " << op.x;
if(op.t >= 2){
out << " " << op.y;
}
if(op.t >= 3){
out << " " << op.z;
}
return out;
}
int n, m, Q, subgroup;
vector<operation> rs;
void add_op(int t, int x, int y = 0, int z = 0){
rs.emplace_back(t, x, y, z);
}
void solve_12(){
rs.clear();
add_op(2, 0, n + 1);
for(int i = 1; i < n; i += 1){
add_op(3, i, n + i, n + i + 1);
}
add_op(2, 2 * n, n);
for(int i = n - 1; i >= 1; i -= 1){
add_op(3, i, n + i, n + i + 1);
}
add_op(2, 0, n + 1);
}
int32_t main(){
if(!local){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int t = 1;
if(local){
t = 1000;
}
while(t--){
cin >> n >> m >> Q >> subgroup;
if(subgroup == 1 || subgroup == 2){
solve_12();
}
cout << rs.size() << "\n";
for(auto x: rs){
cout << x << "\n";
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3640kb
input:
0 2 1 1
output:
3 2 0 1 2 0 0 2 0 1
result:
wrong answer Integer 3 violates the range [0, 1]
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 0ms
memory: 3556kb
input:
0 2 1 4
output:
0
result:
wrong answer Wrong solution.
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Wrong Answer
Test #20:
score: 0
Wrong Answer
time: 0ms
memory: 3644kb
input:
14 16 393 6
output:
0
result:
wrong answer Wrong solution.
Subtask #7:
score: 0
Skipped
Dependency #2:
0%
Subtask #8:
score: 0
Skipped
Dependency #3:
0%