Task: | Gap |
Sender: | henrikaalto |
Submission time: | 2019-04-14 17:20:37 +0300 |
Language: | C++ |
Status: | COMPILE ERROR |
Compiler report
input/code.cpp: In function 'll findGap(int, int)': input/code.cpp:16:11: error: expected ';' before 'std' res std:: max(res,b-a); ^~~ input/code.cpp:16:29: warning: statement has no effect [-Wunused-value] res std:: max(res,b-a); ^ input/code.cpp:7:6: warning: unused variable 'start' [-Wunused-variable] ll start = 0; ^~~~~
Code
#include <bits/stdc++.h> #include "gap.h" typedef long long ll; #define MAX (1e18) ll findGap(int t,int n) { ll res = 0; ll start = 0; ll min = 0, max = 0; (void) MinMax(0,MAX,&min, &max); ll a = min; ll b = max; for (;;) { ll o = b-1; (void) MinMax(0,MAX,&a, &o); if (a == o) { res std:: max(res,b-a); break; } res = std:: max(res, b-o); b = o; } return res; }