#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
//#define int long long;
typedef long long ll;
using namespace std;
const int M = 31;
//#define int ll
int main(){
int n;
cin >> n;
int ans[n+1];
for(int i = 0; i <= n; i++)
{
ans[i] = -1;
}
ans[0] = 0;
int cnt = 1;
for(int i = 1; i <= n; i++)
{
if(ans[i] != -1)
{
continue;
}
ans[i] = cnt;
cnt++;
for(int j = i + 1; j <= n; j++)
{
if(ans[j] != -1)
{
continue;
}
cout << 2 << " " << i << " " << j << endl;
fflush(stdout);
int x;
cin >> x;
fflush(stdout);
if(x == 1)
{
ans[j] = ans[i];
}
}
}
cout << 0 << " ";
fflush(stdout);
//cout << cnt << endl;
for(int i = 1; i < n; i++)
{
cout << ans[i] << " ";
fflush(stdout);
}
cout << ans[n] << endl;
//cout << endl;
fflush(stdout);
return 0;
}
//1 4 5 2 3
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
208 KB |
Output is correct |
2 |
Correct |
20 ms |
208 KB |
Output is correct |
3 |
Partially correct |
59 ms |
208 KB |
Partially correct |
4 |
Partially correct |
32 ms |
208 KB |
Partially correct |
5 |
Correct |
3 ms |
208 KB |
Output is correct |
6 |
Correct |
2 ms |
208 KB |
Output is correct |
7 |
Correct |
6 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
208 KB |
Output is correct |
2 |
Correct |
15 ms |
208 KB |
Output is correct |
3 |
Partially correct |
31 ms |
208 KB |
Partially correct |
4 |
Partially correct |
80 ms |
208 KB |
Partially correct |
5 |
Correct |
4 ms |
208 KB |
Output is correct |
6 |
Correct |
3 ms |
208 KB |
Output is correct |
7 |
Correct |
4 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
208 KB |
Output is correct |
2 |
Correct |
7 ms |
208 KB |
Output is correct |
3 |
Partially correct |
30 ms |
208 KB |
Partially correct |
4 |
Partially correct |
80 ms |
208 KB |
Partially correct |
5 |
Correct |
8 ms |
208 KB |
Output is correct |
6 |
Correct |
5 ms |
208 KB |
Output is correct |
7 |
Correct |
19 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
208 KB |
Output is correct |
2 |
Correct |
6 ms |
208 KB |
Output is correct |
3 |
Partially correct |
47 ms |
208 KB |
Partially correct |
4 |
Partially correct |
120 ms |
208 KB |
Partially correct |
5 |
Correct |
9 ms |
208 KB |
Output is correct |
6 |
Correct |
34 ms |
208 KB |
Output is correct |
7 |
Correct |
21 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
208 KB |
Output is correct |
2 |
Correct |
15 ms |
356 KB |
Output is correct |
3 |
Partially correct |
38 ms |
208 KB |
Partially correct |
4 |
Partially correct |
59 ms |
208 KB |
Partially correct |
5 |
Correct |
33 ms |
208 KB |
Output is correct |
6 |
Partially correct |
44 ms |
208 KB |
Partially correct |
7 |
Partially correct |
78 ms |
208 KB |
Partially correct |