Submission #259592
Source Code Expand
#include <stdio.h> int main(void){ int stime[60000] = {0},ttime[60000] = {0},stest[60000]={0},ttest[60000]={0},data[60000] = {0}; int n,i,z,s1=0,t1=0,r,q =0,count,count2,number=0; scanf("%d", &n); for (i = 0; i < n; i++){ scanf("%d-%d", &stime[i], &ttime[i]); for (; stime[i] % 5 != 0; stime[i]--); for (; ttime[i] % 5 != 0; ttime[i]++); } s1 = stime[0]; t1 = ttime[0]; for(z = 0; z < n; z++){ if(s1 <=stime[z] && ttime[z] <= t1){ }else if(stime[z] <= s1 && t1 <=ttime[z]){ s1 = stime[z]; t1 = ttime[z]; } else if (stime[z] <= s1 && (ttime[z] <= t1 && s1 <= ttime[z])){ s1 = stime[z]; } else if (t1 <= ttime[z]&& (stime[z] <= t1 && s1 <= stime[z])){ t1 =stime[z]; } else { stest[count] = stime[z]; ttest[count] = ttime[z]; count++; } } if (s1 != stime[0] || t1 != ttime[0]){ while(1){ for (q = 0; q < count; q++){ if(s1 <=stime[z] && ttime[z] <= t1){ }else if(stime[z] <= s1 && t1 <=ttime[z]){ s1 = stime[z]; t1 = ttime[z]; }else if (stest[q] <= s1 && (ttest[q] <= t1 && s1 <= ttest[q])){ s1 = stest[q]; data[number] = q; number++; } else if (t1 <= ttest[q]&& (stest[q] <= t1 && s1 <= stest[q])) { t1 = ttest[q]; data[q] = q; } else { count2++; } } if(count2 == count){ break; } } } for (q = 0; q < number; q++){ stest[data[q]]=0; ttest[data[q]]=0; } if (count == n-1){ printf("%04d-%04d\n", stime[0], ttime[0]); } else { printf("%04d-%04d\n", s1, t1); } for (r = 0; r < n; r++){ if (stest[r] != 0 && ttest[r] != 0){ printf("%04d-%04d\n",stest[r], ttest[r]); } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | ne260037 |
Language | C (GCC 4.6.4) |
Score | 0 |
Code Size | 2641 Byte |
Status | TLE |
Exec Time | 2032 ms |
Memory | 2040 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:8:10: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] ./Main.c:11:14: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
Judge Result
Set Name | all | ||||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 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 | RE | 255 ms | 1896 KB |
00_sample_02.txt | AC | 23 ms | 1952 KB |
00_sample_03.txt | RE | 250 ms | 1948 KB |
cho_cho_chokudai.txt | WA | 32 ms | 1952 KB |
chokudai_ga_cho.txt | TLE | 2031 ms | 2036 KB |
test_01.txt | RE | 255 ms | 1832 KB |
test_02.txt | RE | 249 ms | 1952 KB |
test_03.txt | RE | 255 ms | 1908 KB |
test_04.txt | RE | 253 ms | 1904 KB |
test_05.txt | RE | 251 ms | 1952 KB |
test_06.txt | RE | 248 ms | 1904 KB |
test_07.txt | RE | 257 ms | 1948 KB |
test_08.txt | RE | 260 ms | 1940 KB |
test_09.txt | RE | 258 ms | 1948 KB |
test_10.txt | RE | 254 ms | 1948 KB |
test_11.txt | RE | 253 ms | 1908 KB |
test_12.txt | TLE | 2031 ms | 2024 KB |
test_13.txt | RE | 254 ms | 1960 KB |
test_14.txt | RE | 255 ms | 1952 KB |
test_15.txt | TLE | 2032 ms | 2032 KB |
test_16.txt | RE | 256 ms | 1952 KB |
test_17.txt | RE | 256 ms | 1952 KB |
test_18.txt | RE | 249 ms | 1956 KB |
test_19.txt | RE | 251 ms | 1904 KB |
test_20.txt | RE | 250 ms | 1956 KB |
test_21.txt | RE | 260 ms | 1888 KB |
test_22.txt | RE | 258 ms | 1948 KB |
test_23.txt | RE | 268 ms | 1904 KB |
test_24.txt | RE | 276 ms | 1948 KB |
test_25.txt | RE | 281 ms | 1948 KB |
test_26.txt | RE | 265 ms | 1948 KB |
test_27.txt | RE | 273 ms | 1948 KB |
test_28.txt | RE | 260 ms | 1952 KB |
test_29.txt | AC | 24 ms | 1892 KB |
test_30.txt | RE | 245 ms | 1948 KB |
test_31.txt | RE | 256 ms | 1952 KB |
test_32.txt | RE | 261 ms | 1876 KB |
test_33.txt | RE | 262 ms | 1900 KB |
test_34.txt | RE | 255 ms | 1904 KB |
test_35.txt | RE | 255 ms | 1892 KB |
test_36.txt | RE | 263 ms | 1888 KB |
test_37.txt | RE | 252 ms | 1944 KB |
test_38.txt | RE | 253 ms | 1948 KB |
test_39.txt | RE | 263 ms | 1952 KB |
test_40.txt | RE | 263 ms | 1904 KB |
test_41.txt | AC | 32 ms | 1956 KB |
test_42.txt | TLE | 2032 ms | 2008 KB |
test_43.txt | TLE | 2030 ms | 2040 KB |