Submission #14389

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
143892015-05-13 16:49:19kriiiPalembang Bridges (APIO15_bridge)C++14
100 / 100
1323 ms22008 KiB
#include <stdio.h>
#include <functional>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;
struct intv{
intv(long long s_, long long e_){
s = s_; e = e_;
}
long long s,e;
};
bool cmpm(const intv &a, const intv &b){return a.s + a.e < b.s + b.e;}
vector<intv> seg;
set<int> xs;
map<int, int, greater<int> > A[2]; long long sza[2],sa[2];
map<int, int> B[2]; long long szb[2],sb[2];
int K,N;
void push(int i, int x)
{
A[i][x]++; sza[i]++; sa[i] += x;
int p = A[i].begin()->first;
B[i][p]++; szb[i]++; sb[i] += p;
if (--A[i][p] == 0) A[i].erase(p); sza[i]--; sa[i] -= p;
if (szb[i] > sza[i]){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bridge.cpp: In function 'int main()':
bridge.cpp:69: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:72:37: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf ("%c %d %c %d ",&a,&x,&b,&y);
                                     ^
#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...