Submission #685826
Source Code Expand
#include <stdio.h> int main(void){ int i, j, k, n; char nyuryoku[3]; int s[32768], e[32768]; int time[512]; scanf("%d", &n); for(i = 0; i < 512; i++){ time[i] = 0; } for(i = 0; i < n; i++){ scanf("%s" , nyuryoku); nyuryoku[0] = s[i]; nyuryoku[2] = e[i]; for(j = 0; j < 24;j++){ for(k = 0; k < 12; k++){ if(100*j + 5 * k < s[i] && s[i] <= 100*j + 5*k + 5){ time[12*j + k] = time[12*j + k] + 1; } if(100*j + 5 * k < e[i] && e[i] <= 100*j + 5*k + 5){ time[12*j + k + 1] = time[12*j + k + 1] - 1; } } } } for(i = 1; i < n; i++){ time[i] = time[i -1] + time[i]; } for(i = 0; i< n ;i++){ if(time[i] <= 0 && time[i + 1] > 0){ printf("%02d%02d-" ,(i - (i % 12) / 12 , i % 12); }if(time[i] > 0 && time[i + 1] <= 0 ){ printf("%02d%02d\n" ,(i - 1 - (i - 1) % 12)/ 12 , (i - 1) % 12); } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | theMurai |
Language | C (GCC 4.6.4) |
Score | 0 |
Code Size | 1139 Byte |
Status | CE |
Compile Error
./Main.c: In function ‘main’: ./Main.c:36:61: error: expected ‘)’ before ‘;’ token ./Main.c:37:9: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat] ./Main.c:37:9: error: expected ‘;’ before ‘}’ token ./Main.c:8:10: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] ./Main.c:15:14: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]