Submission #292890

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2928902020-09-07 14:38:05arnold518Two Antennas (JOI19_antennas)C++14
100 / 100
1209 ms39388 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;
const ll INF = 1e17;
struct Query
{
int l, r, p;
};
int N, Q;
int A[MAXN+10], B[MAXN+10], H[MAXN+10];
Query C[MAXN+10];
struct Node
{
ll lazy, val, val2;
Node() : lazy(-INF), val(-INF), val2(-INF) {}
};
Node tree[MAXN*4+10];
ll P[MAXN+10], ans[MAXN+10];
Node operator + (Node p, Node q)
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

antennas.cpp: In function 'void init(int, int, int)':
antennas.cpp:53:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   53 |  int mid=tl+tr>>1;
      |          ~~^~~
antennas.cpp: In function 'void update1(int, int, int, int, int, ll)':
antennas.cpp:68:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   68 |  int mid=tl+tr>>1;
      |          ~~^~~
antennas.cpp: In function 'void update2(int, int, int, int, ll)':
antennas.cpp:83:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   83 |  int mid=tl+tr>>1;
      |          ~~^~~
antennas.cpp: In function 'll query(int, int, int, int, int)':
antennas.cpp:94:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   94 |  int mid=tl+tr>>1;
      |          ~~^~~
antennas.cpp: In function 'int main()':
antennas.cpp:120:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  120 |   for(; j<V.size() && V[j].first<=i; j++)
      |         ~^~~~~~~~~
antennas.cpp:143:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  143 |   for(; j<V.size() && V[j].first<=i; j++)
      |         ~^~~~~~~~~
antennas.cpp:100:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  100 |  scanf("%d", &N);
      |  ~~~~~^~~~~~~~~~
antennas.cpp:101:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  101 |  for(int i=1; i<=N; i++) scanf("%d%d%d", &H[i], &A[i], &B[i]);
      |                          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
antennas.cpp:102:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  102 |  scanf("%d", &Q);
      |  ~~~~~^~~~~~~~~~
antennas.cpp:103:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  103 |  for(int i=1; i<=Q; i++) scanf("%d%d", &C[i].l, &C[i].r), C[i].p=i;
      |                          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...