Submission #109380


Source Code Expand

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <sstream>
#include <cstring>
#include <vector>

#define rep2(x,from,to) for(int (x)=(from);(x)<(to);(x)++)
#define rep(x,to) rep2((x),0,(to))
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define FS first
#define SC second

using namespace std;
typedef long long ll;
typedef pair<string,string> pss;


int main()
{
	int n, res=0;
	vector<pss> vp;
	cin >> n;
	string st;
	rep(i,n){
		cin >>st;
		if(st[3]>'0' && st[3]<'5') st[3]='0';
		else if(st[3]>='5' && st[3]<='9') st[3]='5';
		if(st[8]>='1' && st[8]<='5') st[8]='5';
		else if(st[8]>='6' && st[8]<='9'){
			st[8]='0', st[7]+=1;
			if(st[7]=='6' ) st[6]+=1, st[7]='0';
			if(st[6]>'9' )  st[5]+=1, st[6]='0';
		}
		vp.push_back(pss(st.substr(0,4), st.substr(5,4)));
	}

	sort(all(vp));
	string w1=vp[0].FS, w2=vp[0].SC;
	if(n==1){ cout << w1 +"-"+ w2 << endl; return 0;}
	rep2(i,1,n){
		if(vp[i].FS>w2 ){
			cout << w1 +"-"+ w2 << endl;
			w1=vp[i].FS, w2=vp[i].SC;
		}else{
			w2 = max(w2, vp[i].SC);
		}
	}
	cout << w1 +"-"+ w2 << endl;
	
//	for_each(all(vp),[](pss x){cout<<x.FS<<" "<<x.SC<<", ";}); puts("");

	return 0;
}

Submission Info

Submission Time
Task D - 感雨時刻の整理
User damekamo
Language C++11 (GCC 4.8.1)
Score 100
Code Size 1225 Byte
Status AC
Exec Time 82 ms
Memory 4116 KB

Judge Result

Set Name all
Score / Max Score 100 / 100
Status
AC × 48
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 23 ms 792 KB
00_sample_02.txt AC 20 ms 788 KB
00_sample_03.txt AC 22 ms 796 KB
cho_cho_chokudai.txt AC 62 ms 4012 KB
chokudai_ga_cho.txt AC 82 ms 4008 KB
test_01.txt AC 22 ms 812 KB
test_02.txt AC 22 ms 816 KB
test_03.txt AC 23 ms 920 KB
test_04.txt AC 24 ms 920 KB
test_05.txt AC 22 ms 924 KB
test_06.txt AC 22 ms 816 KB
test_07.txt AC 21 ms 920 KB
test_08.txt AC 21 ms 928 KB
test_09.txt AC 21 ms 924 KB
test_10.txt AC 22 ms 840 KB
test_11.txt AC 22 ms 924 KB
test_12.txt AC 22 ms 920 KB
test_13.txt AC 23 ms 792 KB
test_14.txt AC 21 ms 924 KB
test_15.txt AC 22 ms 924 KB
test_16.txt AC 20 ms 920 KB
test_17.txt AC 22 ms 924 KB
test_18.txt AC 20 ms 924 KB
test_19.txt AC 22 ms 920 KB
test_20.txt AC 22 ms 924 KB
test_21.txt AC 68 ms 3996 KB
test_22.txt AC 73 ms 4112 KB
test_23.txt AC 77 ms 4008 KB
test_24.txt AC 69 ms 4004 KB
test_25.txt AC 70 ms 4000 KB
test_26.txt AC 65 ms 4004 KB
test_27.txt AC 67 ms 3996 KB
test_28.txt AC 69 ms 3996 KB
test_29.txt AC 20 ms 796 KB
test_30.txt AC 22 ms 924 KB
test_31.txt AC 27 ms 1328 KB
test_32.txt AC 20 ms 832 KB
test_33.txt AC 57 ms 2956 KB
test_34.txt AC 24 ms 924 KB
test_35.txt AC 22 ms 924 KB
test_36.txt AC 70 ms 4000 KB
test_37.txt AC 72 ms 4000 KB
test_38.txt AC 63 ms 4004 KB
test_39.txt AC 80 ms 4000 KB
test_40.txt AC 68 ms 4112 KB
test_41.txt AC 67 ms 4004 KB
test_42.txt AC 71 ms 4116 KB
test_43.txt AC 76 ms 3996 KB