Submission #1011739

# Submission time Handle Problem Language Result Execution time Memory
1011739 2024-07-01T07:54:47 Z uranhishig Hotter Colder (IOI10_hottercolder) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

int Guess(int G);
 
//int run(int L, int R) {
//    if(L == R){
//    	return 1;
//	}
//}

int HC(int n){
	int x = 0, i;
	bool x = true;
   for(int i = 1; i <= 500; i++){
   		if(Guess(i) == -1){
   				break;
   				x = false;
		   }
   }
   if(x){
   		cout << "500" << endl;
   }
   else{
   	   cout << i << endl;
   }

}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:14:7: error: conflicting declaration 'bool x'
   14 |  bool x = true;
      |       ^
hottercolder.cpp:13:6: note: previous declaration as 'int x'
   13 |  int x = 0, i;
      |      ^
hottercolder.cpp:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
   28 | }
      | ^