Submission #592357

#TimeUsernameProblemLanguageResultExecution timeMemory
592357ogibogi2004Hotter Colder (IOI10_hottercolder)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "grader.h" using namespace std; int HC(int N) { srand(69); Guess(1); int last=1,l=1,r=N; while(l<r) { int mid=rand()%(r-l+1)+l; string t=Guess(mid); int l1=N+1,r1=0; for(int j=l;j<=r;j++) { int dist1=abs(mid-j); int dist2=abs(last-j); if(t=="same"&&dist1==dist2) { l1=min(l1,j); r1=max(r1,j); } if(t=="hotter"&&dist1<dist2) { l1=min(l1,j); r1=max(r1,j); } if(t=="colder"&&dist1<dist2) { l1=min(l1,j); r1=max(r1,j); } } last=mid; l=l1;r=r1; } return l; }

Compilation message (stderr)

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:13:23: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   13 |         string t=Guess(mid);
      |                  ~~~~~^~~~~