Submission #1090601

#TimeUsernameProblemLanguageResultExecution timeMemory
1090601damas_codeHotter Colder (IOI10_hottercolder)C++17
0 / 100
533 ms57608 KiB
#include <bits/stdc++.h> #include "grader.h" using namespace std; int HC(int N){ int l = 0, r = N-1; // it will return same int pg = r; int pp = Guess(pg); int g = (l+r)/2; int p = Guess(g); if (p == 1) r = ((pg + g)/2) -1; //hotter else if (p == 0) return (pg + g)/2; //same else l = ((pg + g)/2) +1; //colder while (l < r){ int pg = r; int pp = Guess(pg); int g = (l+r)/2; int p = Guess(g); if (p == 1) r = ((pg + g)/2) -1; //hotter else if (p == 0) return (pg + g) /2; //same else l = ((pg + g)/2) +1; //colder } return l; }

Compilation message (stderr)

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:20:13: warning: unused variable 'pp' [-Wunused-variable]
   20 |         int pp = Guess(pg);
      |             ^~
hottercolder.cpp:10:9: warning: unused variable 'pp' [-Wunused-variable]
   10 |     int pp = Guess(pg);
      |         ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...