Created
October 12, 2013 11:17
-
-
Save op01/6948875 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<cstdlib> | |
#include<ctime> | |
#include<cmath> | |
#include<unistd.h> | |
#include<cstdio> | |
#include<sstream> | |
#include<string.h> | |
using namespace std; | |
int main() | |
{ | |
int n; | |
cin>>n; | |
int sl[256]; | |
for(int i=0;i<256;i++) | |
{ | |
sl[i]=0; | |
} | |
for(int i=0;i<n;i++) | |
{ | |
int l,h,r; | |
cin>>l>>h>>r; | |
for(int j=l;j<r;j++) | |
{ | |
if(h>sl[j])sl[j] = h; | |
} | |
} | |
int earth=0; | |
for(int i=1;i<256;i++) | |
{ | |
if(earth!=sl[i]) | |
{ | |
cout<<i<<" "<<sl[i]<<" "; | |
earth = sl[i]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment