Submission #21066

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
210662017-04-04 09:33:22sbansalcsFortune Telling 2 (JOI14_fortune_telling2)C++14
100 / 100
493 ms43976 KiB
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define mid (start+end)/2
const int N = 2e5+2;
const int M=N*12,N2=N*3;
typedef long long ll;
int A[N],B[N],arr[N],T[N];
int ans[N*2];
int TREE2[M];
int D[N],X[N],Y[N];
int bit[N2];
ll act[N2];
int G;
void update2(int idx, int start, int end, int x, int v) {
if(start==end) TREE2[idx]=v;
else if(x<=mid) update2(idx*2, start, mid, x, v);
else update2(idx*2+1, mid+1, end, x, v);
TREE2[idx]=v;
}
int query2(int idx, int start, int end, int a, int b) {
if(b<a) return 0;
if(start>=a && end<=b) return TREE2[idx];
else if(start>b || end<a) return 0;
else return max(query2(idx*2, start, mid,a,b),query2(idx*2+1, mid+1, end,a,b));
}
void add(int i, int v) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

fortune_telling2.cpp: In function 'int main()':
fortune_telling2.cpp:64:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while (i<vt.size()) {
             ^
fortune_telling2.cpp:69:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         while (i<vt.size() && vt[i].first==h) {
                 ^
fortune_telling2.cpp:51:35: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int n,k,x;scanf("%d %d",&n,&k);
                                   ^
fortune_telling2.cpp:53:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&x);
                       ^
fortune_telling2.cpp:55:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&x);
                       ^
fortune_telling2.cpp:59:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&x);
                       ^

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...