Submission #205999

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2059992020-03-01 19:47:21arnold518Fire (JOI20_ho_t5)C++14
100 / 100
378 ms41544 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 2e5;
struct Query { ll x, y, idx; };
struct Point { ll x, y, v; };
struct Line
{
ll a, b;
Line() : a(0), b(0) {}
Line(ll a, ll b) : a(a), b(b) {}
};
Line operator + (const Line &p, const Line &q) { return Line(p.a+q.a, p.b+q.b); }
int N, Q;
ll A[MAXN+10], B[MAXN+10];
vector<Query> query;
vector<Point> point;
struct BIT
{
Line tree[MAXN+10];
BIT() { for(int i=0; i<MAXN+10; i++) tree[i]=Line(); }
void update(int i, Line p) { for(; i<=N+1; i+=(i&-i)) tree[i]=tree[i]+p; }
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

ho_t5.cpp: In function 'int main()':
ho_t5.cpp:81:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(i=0, j=0; i<query.size(); i++)
                ~^~~~~~~~~~~~~
ho_t5.cpp:83:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(; j<point.size() && point[j].y-point[j].x<=query[i].y-query[i].x; j++) bit.update(point[j].x, {point[j].v, -point[j].v*(point[j].x-1)});
         ~^~~~~~~~~~~~~
ho_t5.cpp:93:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(i=0, j=0; i<query.size(); i++)
                ~^~~~~~~~~~~~~
ho_t5.cpp:95:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(; j<point.size() && point[j].y-point[j].x>query[i].y-query[i].x; j++) bit.update(point[j].y, {point[j].v, -point[j].v*(point[j].y-1)});
         ~^~~~~~~~~~~~~
ho_t5.cpp:38:12: warning: unused variable 'k' [-Wunused-variable]
  int i, j, k;
            ^
ho_t5.cpp:40:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &N, &Q);
  ~~~~~^~~~~~~~~~~~~~~~
ho_t5.cpp:41:42: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(i=1; i<=N; i++) scanf("%lld", &A[i]), B[i]=B[i-1]+A[i];
                      ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
ho_t5.cpp:45:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld%lld%lld", &t, &l, &r);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...