Submission #14914

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
149142015-07-06 00:30:27aintaPalembang Bridges (APIO15_bridge)C++98
100 / 100
316 ms22228 KiB
#include<stdio.h>
#include<algorithm>
#define SZ 262144
using namespace std;
int K, n;
long long Res, SS, D1[101000], D2[101000];
struct A{
int b, e, num;
bool operator<(const A &p)const{
return b+e<p.b+p.e;
}
}w[101000];
int Num[101000];
struct AA{
int x, num;
bool operator<(const AA &p)const{
return x<p.x;
}
}ord[201000];
long long IT[SZ+SZ+1][4];
void Ins(int pv, int a, int b){
a+=SZ;
while(a){
IT[a][pv]+=b;
a>>=1;
}
}
int Findx(int node, int g){
if(node >= SZ)return node-SZ;
if(IT[node*2][0] + IT[node*2][1] < g)return Findx(node*2+1,g-IT[node*2][0] - IT[node*2][1]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bridge.cpp: In function 'int main()':
bridge.cpp:48:25: warning: unused variable 'e' [-Wunused-variable]
     int i, a, b, c = 0, e, mid, r, pv = 1;
                         ^
bridge.cpp:48:28: warning: unused variable 'mid' [-Wunused-variable]
     int i, a, b, c = 0, e, mid, r, pv = 1;
                            ^
bridge.cpp:48:33: warning: unused variable 'r' [-Wunused-variable]
     int i, a, b, c = 0, e, mid, r, pv = 1;
                                 ^
bridge.cpp:48:36: warning: unused variable 'pv' [-Wunused-variable]
     int i, a, b, c = 0, e, mid, r, pv = 1;
                                    ^
bridge.cpp:49:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&K,&n);
                        ^
bridge.cpp:52:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",p1);
                       ^
bridge.cpp:53:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a);
                       ^
bridge.cpp:54:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",p2);
                       ^
bridge.cpp:55:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&b);
                       ^
#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...