Submission #894223

#TimeUsernameProblemLanguageResultExecution timeMemory
894223boxIntercastellar (JOI22_ho_t1)C++17
100 / 100
88 ms7716 KiB
#include <array> #include <iostream> using namespace std; #define ar array const int N = 2e5; int main() { int n; scanf("%d", &n); static ar<int, 2> a[N]; for (int i = 0; i < n; i++) { scanf("%d", &a[i][0]); a[i][1] = 1; while (a[i][0] % 2 == 0) a[i][0] /= 2, a[i][1] *= 2; } int i = 0; long long p = 0; int q; scanf("%d", &q); while (q--) { long long x; scanf("%lld", &x); x -= p; while (a[i][1] < x) x -= a[i][1], p += a[i][1], i++; printf("%d\n", a[i][0]); } return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:11:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%d", &n);
      |   ~~~~~^~~~~~~~~~
Main.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("%d", &a[i][0]);
      |     ~~~~~^~~~~~~~~~~~~~~~
Main.cpp:21:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |   scanf("%d", &q);
      |   ~~~~~^~~~~~~~~~
Main.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |     scanf("%lld", &x);
      |     ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...