Submission #64066

#TimeUsernameProblemLanguageResultExecution timeMemory
64066Just_Solve_The_ProblemZalmoxis (BOI18_zalmoxis)C++17
0 / 100
337 ms8440 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const int N = (int)1e6 + 7; const int inf = (int)1e9 + 7; int n, k; ll a[N]; map < ll, int > cnt; int table[21][N]; int numlog[N]; void build() { for (int i = 2; i < N; i++) { numlog[i] = numlog[i / 2] + 1; } for (int i = 0; i <= 20; i++) { for (int j = 1; j <= n; j++) { if (!i) { table[i][j] = a[j]; } else { table[i][j] = min(table[i - 1][j], table[i - 1][min(j + (1 << (i - 1)), n)]); } } } } int getmin(int l, int r) { int lg = numlog[r - l + 1]; return min(table[lg][l], table[lg][r - (1 << lg) + 1]); } main() { scanf("%d %d", &n, &k); ll mn = (ll)1e18; for (int i = 1; i <= n; i++) { cin >> a[i]; assert(a[i] <= (int)1e6); mn = min(mn, a[i]); cnt[a[i]]++; } return 0; int in; ll cur = -1; while (1) { if (cnt[mn] & 1) { cur = mn; break; } cnt[mn + 1] += cnt[mn] / 2; cnt[mn] = 0; mn++; } }

Compilation message (stderr)

zalmoxis.cpp:36:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main() {
      ^
zalmoxis.cpp: In function 'int main()':
zalmoxis.cpp:46:7: warning: unused variable 'in' [-Wunused-variable]
   int in;
       ^~
zalmoxis.cpp:47:6: warning: variable 'cur' set but not used [-Wunused-but-set-variable]
   ll cur = -1;
      ^~~
zalmoxis.cpp:37:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &n, &k);
   ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...