Submission #67164

#TimeUsernameProblemLanguageResultExecution timeMemory
67164imeimi2000Worst Reporter 3 (JOI18_worst_reporter3)C++17
Compilation error
0 ms0 KiB
#include <iostream> #include <algorithm> #include <vector> #include <queue> #include <deque> #include <set> #include <map> #include <unordered_map> #include <functional> #include <cstring> #include <cmath> #include <ctime> #include <cstdlib> using namespace std; typedef long long llong; typedef long double ld; typedef pair<int, int> pii; typedef pair<llong, llong> pll; int n; llong d[500001]; int getPos(int i, int t) { return i - t / d[i] * d[i]; } int lowbound(int x, int t) { int s = 0, e = n + 1; while (s < e) { int m = (s + e) / 2; if (getPos(m, t) < x) s = m + 1; else e = m; } return s; } int main() { int q;    scanf("%d%d", &n, &q);    d[0] = 1; for (int i = 1; i <= n; ++i) {        scanf("%lld", d + i);        d[i] = ((d[i] - 1) / d[i - 1] + 1) * d[i - 1]; } while (q--) { int t, l, r; cin >> t >> l >> r; printf("%d\n", lowbound(-l + 1, t) - lowbound(-r, t)); } return 0; }

Compilation message (stderr)

worst_reporter3.cpp:40:2: error: stray '\302' in program
     scanf("%d%d", &n, &q);
  ^
worst_reporter3.cpp:40:3: error: stray '\240' in program
     scanf("%d%d", &n, &q);
   ^
worst_reporter3.cpp:40:5: error: stray '\302' in program
     scanf("%d%d", &n, &q);
     ^
worst_reporter3.cpp:40:6: error: stray '\240' in program
     scanf("%d%d", &n, &q);
      ^
worst_reporter3.cpp:41:2: error: stray '\302' in program
     d[0] = 1;
  ^
worst_reporter3.cpp:41:3: error: stray '\240' in program
     d[0] = 1;
   ^
worst_reporter3.cpp:41:5: error: stray '\302' in program
     d[0] = 1;
     ^
worst_reporter3.cpp:41:6: error: stray '\240' in program
     d[0] = 1;
      ^
worst_reporter3.cpp:43:2: error: stray '\302' in program
         scanf("%lld", d + i);
  ^
worst_reporter3.cpp:43:3: error: stray '\240' in program
         scanf("%lld", d + i);
   ^
worst_reporter3.cpp:43:5: error: stray '\302' in program
         scanf("%lld", d + i);
     ^
worst_reporter3.cpp:43:6: error: stray '\240' in program
         scanf("%lld", d + i);
      ^
worst_reporter3.cpp:43:8: error: stray '\302' in program
         scanf("%lld", d + i);
        ^
worst_reporter3.cpp:43:9: error: stray '\240' in program
         scanf("%lld", d + i);
         ^
worst_reporter3.cpp:43:11: error: stray '\302' in program
         scanf("%lld", d + i);
           ^
worst_reporter3.cpp:43:12: error: stray '\240' in program
         scanf("%lld", d + i);
            ^
worst_reporter3.cpp:44:2: error: stray '\302' in program
         d[i] = ((d[i] - 1) / d[i - 1] + 1) * d[i - 1];
  ^
worst_reporter3.cpp:44:3: error: stray '\240' in program
         d[i] = ((d[i] - 1) / d[i - 1] + 1) * d[i - 1];
   ^
worst_reporter3.cpp:44:5: error: stray '\302' in program
         d[i] = ((d[i] - 1) / d[i - 1] + 1) * d[i - 1];
     ^
worst_reporter3.cpp:44:6: error: stray '\240' in program
         d[i] = ((d[i] - 1) / d[i - 1] + 1) * d[i - 1];
      ^
worst_reporter3.cpp:44:8: error: stray '\302' in program
         d[i] = ((d[i] - 1) / d[i - 1] + 1) * d[i - 1];
        ^
worst_reporter3.cpp:44:9: error: stray '\240' in program
         d[i] = ((d[i] - 1) / d[i - 1] + 1) * d[i - 1];
         ^
worst_reporter3.cpp:44:11: error: stray '\302' in program
         d[i] = ((d[i] - 1) / d[i - 1] + 1) * d[i - 1];
           ^
worst_reporter3.cpp:44:12: error: stray '\240' in program
         d[i] = ((d[i] - 1) / d[i - 1] + 1) * d[i - 1];
            ^
worst_reporter3.cpp: In function 'int main()':
worst_reporter3.cpp:40:12: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &n, &q);
       ~~~~~^~~~~~~~~~~~~~~~
worst_reporter3.cpp:43:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld", d + i);
             ~~~~~^~~~~~~~~~~~~~~