Submission #39536

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
395362018-01-16 09:53:0314kg역사적 조사 (JOI14_historical)C++11
40 / 100
4000 ms14940 KiB
#include <stdio.h>
#include <algorithm>
#include <set>
#include <map>
#define N 100001
#define NN 262144
#define SQ 300
#define max2(x,y) (x>y?x:y)
using namespace std;
typedef pair<pair<int, int>, int> ppi;
int n, q_len, M_len, nn, in[N];
long long tree[NN], out[N];
ppi Q[N];
set<int> S;
map<int, int> M;
bool cmp(ppi x, ppi y) {
pair<int,int> tx = { x.first.first / SQ,x.first.second / SQ };
pair<int,int> ty = { y.first.first / SQ,y.first.second / SQ };
return x < y;
}
void Update(int lev) {
tree[lev] = max2(tree[lev * 2], tree[lev * 2 + 1]);
if (lev > 1) Update(lev / 2);
}
void Push(int x, long long num) {
tree[nn + x - 1] += num;
Update((nn + x - 1) / 2);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

historic.cpp: In function 'bool cmp(ppi, ppi)':
historic.cpp:19:16: warning: variable 'tx' set but not used [-Wunused-but-set-variable]
  pair<int,int> tx = { x.first.first / SQ,x.first.second / SQ };
                ^
historic.cpp:20:16: warning: variable 'ty' set but not used [-Wunused-but-set-variable]
  pair<int,int> ty = { y.first.first / SQ,y.first.second / SQ };
                ^
historic.cpp: In function 'int main()':
historic.cpp:32:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &q_len);
                            ^
historic.cpp:33:67: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (int i = 1; i <= n; i++) scanf("%d", &in[i]), S.insert(in[i]);
                                                                   ^
historic.cpp:38:56: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &Q[i].first.first, &Q[i].first.second);
                                                        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...