Submission #617767

# Submission time Handle Problem Language Result Execution time Memory
617767 2022-08-01T13:53:12 Z Elnady Carnival (CEOI14_carnival) C++17
0 / 100
15 ms 208 KB
#include <bits/stdc++.h>

using namespace std;
#define     endl                '\n'
#define     int                 long long
#define     all(pr1)            pr1.begin(),pr1.end()
#define     alr(pr1)            pr1.rbegin(),pr1.rend()
#define     CEIL(pr1, pr2)      (pr1 + pr2 - 1) / pr2
#define     IOS                 std::ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define		RT(s)				return cout<<s,0
#define		sz(s)				(long long)(s.size())

const long long N = 10 + 9, M = 150 + 9, MOD = 1e9 + 7, OO = 0x3f3f3f3f, MAX = 2147483647, LOO = 0x3f3f3f3f3f3f3f3f;

vector<int> a = { 1, 2, 1, 3, 2 };

int32_t main()
{
	//IOS;
	int n;
	cin >> n;
	vector<int> ans(n);
	ans[0] = 0;
	int cnt = 1;
	for (int i = 1; i < n; i++)
	{
		bool can = 0;
		for (int j = 0; j < i; j++)
		{
			int x = 0;
			cout << "2 " << i + 1 << " " << j + 1 << "\n";
			fflush(stdout);
			cin >> x;
			if (x == 1)
			{
				can = 1;
				ans[i] = j;
				break;
			}
		}
		if (!can)
			ans[i] = cnt++;
	}
	cout << "0 ";
	for (int i = 0; i < n; i++)
		cout << ans[i] + 1 << " ";
	cout << "\n";
	fflush(stdout);
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 208 KB Integer 19 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 208 KB Integer 6 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 10 ms 208 KB Integer 11 violates the range [1, 8]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 208 KB Integer 5 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 208 KB Output is correct
2 Incorrect 15 ms 208 KB Integer 22 violates the range [1, 17]
3 Halted 0 ms 0 KB -