Submission #471645
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
#define li long long int
#define rep(i,to) for(li i=0;i<((li)(to));i++)
#define repp(i,start,to) for(li i=(li)(start);i<((li)(to));i++)
#define pb push_back
#define sz(v) ((li)(v).size())
#define bgn(v) ((v).begin())
#define eend(v) ((v).end())
#define allof(v) (v).begin(), (v).end()
#define dodp(v,n) memset(v,(li)n,sizeof(v))
#define bit(n) (1ll<<(li)(n))
#define mp(a,b) make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;
#define INF bit(60)
#define DBGP 1
#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b) idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c) idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d) idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e) idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f) idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g) idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h) idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i) idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j) idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v) for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x) idp p2((x).F, (x).S)
#define dump(x,n) idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n) idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x) idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x) idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}
#define read2d(a,w,h) rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h) rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}
typedef pair<li, li> PI;
string s[30303];
li rnd(string x,bool start){
if(start)return atoi(x.c_str())/5*5;
li t=(atoi(x.c_str())+4)/5*5;
if(t%100==60){
t=(t/100)*100+100;
}
return t;
}
int main(){
li n;
cin>>n;
rin{cin>>s[i];}
sort(s,s+n);
vector<PI> res;
li prev_start=-1;
li prev_end=-1;
rin{
li current_start=rnd(s[i].substr(0,4),true);
li current_end=rnd(s[i].substr(5,4),false);
if(current_start<=prev_end){
prev_end=max(current_end,prev_end);
}else{
if(prev_end>=0)res.pb({prev_start,prev_end});
prev_start=current_start;
prev_end=current_end;
}
}
res.pb({prev_start,prev_end});
rep(i,sz(res)){
printf("%04lld-%04lld\n",res[i].F,res[i].S);
}
return 0;
}
Submission Info
Submission Time |
|
Task |
D - 感雨時刻の整理 |
User |
ynq1242 |
Language |
C++11 (GCC 4.8.1) |
Score |
100 |
Code Size |
2777 Byte |
Status |
AC |
Exec Time |
94 ms |
Memory |
2932 KB |
Judge Result
Set Name |
all |
Score / Max Score |
100 / 100 |
Status |
|
Set Name |
Test Cases |
all |
00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, cho_cho_chokudai.txt, chokudai_ga_cho.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt, test_41.txt, test_42.txt, test_43.txt |
Case Name |
Status |
Exec Time |
Memory |
00_sample_01.txt |
AC |
27 ms |
1008 KB |
00_sample_02.txt |
AC |
24 ms |
1000 KB |
00_sample_03.txt |
AC |
25 ms |
1052 KB |
cho_cho_chokudai.txt |
AC |
80 ms |
2932 KB |
chokudai_ga_cho.txt |
AC |
93 ms |
2920 KB |
test_01.txt |
AC |
26 ms |
1056 KB |
test_02.txt |
AC |
27 ms |
1124 KB |
test_03.txt |
AC |
30 ms |
996 KB |
test_04.txt |
AC |
26 ms |
1052 KB |
test_05.txt |
AC |
27 ms |
1052 KB |
test_06.txt |
AC |
26 ms |
1052 KB |
test_07.txt |
AC |
25 ms |
1048 KB |
test_08.txt |
AC |
27 ms |
1000 KB |
test_09.txt |
AC |
27 ms |
1132 KB |
test_10.txt |
AC |
27 ms |
1124 KB |
test_11.txt |
AC |
26 ms |
1136 KB |
test_12.txt |
AC |
26 ms |
1184 KB |
test_13.txt |
AC |
26 ms |
1056 KB |
test_14.txt |
AC |
27 ms |
1132 KB |
test_15.txt |
AC |
27 ms |
1176 KB |
test_16.txt |
AC |
28 ms |
1056 KB |
test_17.txt |
AC |
26 ms |
1132 KB |
test_18.txt |
AC |
26 ms |
1124 KB |
test_19.txt |
AC |
26 ms |
1136 KB |
test_20.txt |
AC |
27 ms |
1184 KB |
test_21.txt |
AC |
94 ms |
2916 KB |
test_22.txt |
AC |
93 ms |
2912 KB |
test_23.txt |
AC |
90 ms |
2920 KB |
test_24.txt |
AC |
89 ms |
2928 KB |
test_25.txt |
AC |
90 ms |
2920 KB |
test_26.txt |
AC |
86 ms |
2924 KB |
test_27.txt |
AC |
80 ms |
2916 KB |
test_28.txt |
AC |
87 ms |
2924 KB |
test_29.txt |
AC |
26 ms |
1004 KB |
test_30.txt |
AC |
26 ms |
1048 KB |
test_31.txt |
AC |
33 ms |
1252 KB |
test_32.txt |
AC |
25 ms |
1056 KB |
test_33.txt |
AC |
66 ms |
2268 KB |
test_34.txt |
AC |
27 ms |
1004 KB |
test_35.txt |
AC |
28 ms |
1056 KB |
test_36.txt |
AC |
89 ms |
2912 KB |
test_37.txt |
AC |
92 ms |
2924 KB |
test_38.txt |
AC |
86 ms |
2920 KB |
test_39.txt |
AC |
89 ms |
2916 KB |
test_40.txt |
AC |
87 ms |
2916 KB |
test_41.txt |
AC |
85 ms |
2912 KB |
test_42.txt |
AC |
83 ms |
2916 KB |
test_43.txt |
AC |
94 ms |
2932 KB |