QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#99529 | #6319. Parallel Processing (Easy) | Sorting# | WA | 2ms | 3472kb | C++23 | 3.5kb | 2023-04-22 22:01:30 | 2023-04-22 22:01:34 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> void check_min(T &a, const T &b){ a = (a < b) ? a : b; }
template<class T> void check_max(T &a, const T &b){ a = (a > b) ? a : b; }
#define all(x) (x).begin(), (x).end()
void output(vector<vector<array<int, 3>>> ins){
cout << ins.size() << "\n";
for(auto v: ins){
for(auto [a, b, c]: v)
cout << a << " " << b << " " << c << "\n";
}
exit(0);
}
void fix_add(vector<array<int, 3>> &add){
while(add.size() != 4){
add.push_back({2000, 2000, 2000});
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<vector<array<int, 3>>> ins{
{
{2, 1, 2},
{4, 3, 4},
{6, 5, 6},
{8, 7, 8},
},
{
{3, 2, 3},
{4, 2, 4},
{7, 6, 7},
{8, 6, 8},
},
{
{5, 4, 5},
{6, 4, 6},
{7, 4, 7},
{8, 4, 8},
}
};
if(n <= 8){
if(n <= 2){
ins.resize(1);
output(ins);
}
if(n <= 4){
ins.resize(2);
output(ins);
}
output(ins);
}
ins.clear();
typedef vector<array<int, 3>> vec;
if(n <= 11){
ins.push_back(vec{
{2, 1, 2},
{4, 3, 4},
{6, 5, 6},
{9, 8, 9},
});
ins.push_back({
{4, 2, 4},
{7, 6, 7},
{10, 9, 10},
{3, 2, 3},
});
ins.push_back({
{5, 4, 5},
{6, 4, 6},
{7, 4, 7},
{11, 10, 11},
});
ins.push_back({
{8, 7, 8},
{9, 7, 9},
{10, 7, 10},
{11, 7, 11},
});
output(ins);
}
if(n <= 13){
ins.push_back({
{2, 1, 2},
{4, 3, 4},
{6, 5, 6},
{9, 8, 9},
});
ins.push_back({
{4, 2, 4},
{7, 6, 7},
{10, 9, 10},
{12, 11, 12},
});
ins.push_back({
{5, 4, 5},
{6, 4, 6},
{7, 4, 7},
{13, 11, 13}
});
ins.push_back({
{8, 7, 8},
{9, 7, 9},
{10, 7, 10},
{3, 2, 3}
});
ins.push_back({
{11, 10, 11},
{12, 10, 12},
{13, 10, 13}
});
output(ins);
}
if(n <= 16){
ins.push_back({
{2, 1, 2},
{4, 3, 4},
{6, 5, 6},
{9, 8, 9},
});
ins.push_back({
{4, 2, 4},
{7, 6, 7},
{10, 9, 10},
{12, 11, 12},
});
ins.push_back({
{5, 4, 5},
{6, 4, 6},
{7, 4, 7},
{13, 11, 13}
});
ins.push_back({
{8, 7, 8},
{9, 7, 9},
{10, 7, 10},
{15, 14, 15}
});
ins.push_back({
{11, 10, 11},
{12, 10, 12},
{13, 10, 13},
{16, 14, 16}
});
ins.push_back({
{14, 13, 14},
{15, 13, 15},
{16, 13, 16},
{3, 2, 3}
});
output(ins);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3340kb
input:
2
output:
1 2 1 2 4 3 4 6 5 6 8 7 8
result:
ok AC
Test #2:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
4
output:
2 2 1 2 4 3 4 6 5 6 8 7 8 3 2 3 4 2 4 7 6 7 8 6 8
result:
ok AC
Test #3:
score: 0
Accepted
time: 1ms
memory: 3416kb
input:
3
output:
2 2 1 2 4 3 4 6 5 6 8 7 8 3 2 3 4 2 4 7 6 7 8 6 8
result:
ok AC
Test #4:
score: 0
Accepted
time: 1ms
memory: 3344kb
input:
5
output:
3 2 1 2 4 3 4 6 5 6 8 7 8 3 2 3 4 2 4 7 6 7 8 6 8 5 4 5 6 4 6 7 4 7 8 4 8
result:
ok AC
Test #5:
score: 0
Accepted
time: 2ms
memory: 3416kb
input:
6
output:
3 2 1 2 4 3 4 6 5 6 8 7 8 3 2 3 4 2 4 7 6 7 8 6 8 5 4 5 6 4 6 7 4 7 8 4 8
result:
ok AC
Test #6:
score: 0
Accepted
time: 0ms
memory: 3420kb
input:
7
output:
3 2 1 2 4 3 4 6 5 6 8 7 8 3 2 3 4 2 4 7 6 7 8 6 8 5 4 5 6 4 6 7 4 7 8 4 8
result:
ok AC
Test #7:
score: 0
Accepted
time: 0ms
memory: 3348kb
input:
8
output:
3 2 1 2 4 3 4 6 5 6 8 7 8 3 2 3 4 2 4 7 6 7 8 6 8 5 4 5 6 4 6 7 4 7 8 4 8
result:
ok AC
Test #8:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
9
output:
4 2 1 2 4 3 4 6 5 6 9 8 9 4 2 4 7 6 7 10 9 10 3 2 3 5 4 5 6 4 6 7 4 7 11 10 11 8 7 8 9 7 9 10 7 10 11 7 11
result:
ok AC
Test #9:
score: 0
Accepted
time: 2ms
memory: 3472kb
input:
10
output:
4 2 1 2 4 3 4 6 5 6 9 8 9 4 2 4 7 6 7 10 9 10 3 2 3 5 4 5 6 4 6 7 4 7 11 10 11 8 7 8 9 7 9 10 7 10 11 7 11
result:
ok AC
Test #10:
score: 0
Accepted
time: 2ms
memory: 3452kb
input:
11
output:
4 2 1 2 4 3 4 6 5 6 9 8 9 4 2 4 7 6 7 10 9 10 3 2 3 5 4 5 6 4 6 7 4 7 11 10 11 8 7 8 9 7 9 10 7 10 11 7 11
result:
ok AC
Test #11:
score: -100
Wrong Answer
time: 0ms
memory: 3312kb
input:
12
output:
5 2 1 2 4 3 4 6 5 6 9 8 9 4 2 4 7 6 7 10 9 10 12 11 12 5 4 5 6 4 6 7 4 7 13 11 13 8 7 8 9 7 9 10 7 10 3 2 3 11 10 11 12 10 12 13 10 13
result:
wrong output format Unexpected end of file - int32 expected