Submission #790991

# Submission time Handle Problem Language Result Execution time Memory
790991 2023-07-23T10:41:08 Z 0123xx Carnival (CEOI14_carnival) C++14
0 / 100
15 ms 336 KB
#include <bits/stdc++.h>
using namespace std;
int n, cur = 1, res, oldres, l, r, m;
vector<int> v, a;
vector<int> adj[155];
int ans[155];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin >> n;
    oldres = 0;
    for (int i = 1; i<= n; i++){
    	ans[i] = i;
	}
    for (int i = 1; i<= n; i++){
        cout << cur << " ";
        for (int j = 0; j< v.size(); j++) cout << v[j] << " ";
        cout << i;
        cout << endl;
        cin >> res;
        if (res > oldres){
        	//rew costume
            v.push_back(i);
            cur++;
        }
        else{
            //repeat
            a.push_back(i);
        }
        oldres = res;
    }
    for (int i = 0; i< v.size(); i++){
    	for (int j = 0; j< a.size(); j++){
    		cout << "2 " << v[i] << " " << a[j] << endl;
    		cin >> res;
    		if (res == 1) ans[a[j]] = ans[v[i]];
		}
	}
	cout << "0";
	for (int i = 1; i<= n; i++) {
		cout << " " << ans[i];
	}
	cout << endl;
}

Compilation message

carnival.cpp: In function 'int main()':
carnival.cpp:17:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |         for (int j = 0; j< v.size(); j++) cout << v[j] << " ";
      |                         ~^~~~~~~~~~
carnival.cpp:32:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     for (int i = 0; i< v.size(); i++){
      |                     ~^~~~~~~~~~
carnival.cpp:33:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |      for (int j = 0; j< a.size(); j++){
      |                      ~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 312 KB Integer 19 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 312 KB Integer 6 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 208 KB Output is correct
2 Incorrect 11 ms 208 KB Integer 11 violates the range [1, 8]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 324 KB Integer 5 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 208 KB Output is correct
2 Incorrect 15 ms 336 KB Integer 20 violates the range [1, 17]
3 Halted 0 ms 0 KB -