Submission #2448680
Source Code Expand
#include <string> #include <iostream> #include <algorithm> using namespace std; int convert_time(string s) { int hx = (s[0] - '0') * 10 + (s[1] - '0'); int mx = (s[3] - '0') * 10 + (s[4] - '0'); int sx = (s[6] - '0') * 10 + (s[7] - '0'); int fx = (s[9] - '0') * 100 + (s[10] - '0') * 10 + (s[11] - '0'); return hx * 3600000 + mx * 60000 + sx * 1000 + fx; } int n, a[109], b[109]; int main() { cin >> n; for (int i = 0; i < n; i++) { string sa, sb; cin >> sa >> sb; a[i] = convert_time(sa); b[i] = convert_time(sb); } int pl = -1, pr = -1; for (int i = 0; i < n; i++) { if (a[i] < b[i]) continue; if (pl == -1) { pl = a[i]; pr = b[i] + 1000; } else { pl = max(pl, a[i]); pr = min(pr, b[i] + 1000); } } if (pl == -1) { for (int i = 0; i < n; i++) { cout << "-1\n"; } } else { for (int i = 0; i < n; i++) { if (a[i] < b[i]) { if ((pl < a[i] && a[i] < pr) || (pl - 1000 < b[i] && b[i] < pr)) { cout << "-1\n"; } else if (a[i] <= pl && pr <= b[i]) { cout << b[i] - a[i] + 1000 << "\n"; } else { cout << b[i] - a[i] << "\n"; } } else { cout << b[i] - a[i] + 1000 << "\n"; } } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - stepモード |
User | square1001 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1251 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | All | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 50 | ||||
Status |
|
Set Name | Test Cases |
---|---|
All | 00_corner100.txt, 00_corner101.txt, 00_corner102.txt, 00_corner103.txt, 00_corner104.txt, 00_corner105.txt, 00_corner106.txt, 00_corner107.txt, 00_corner108.txt, 00_corner109.txt, 00_corner110.txt, 00_corner111.txt, 00_corner112.txt, 00_corner113.txt, 00_corner114.txt, 00_corner115.txt, 00_corner116.txt, 00_corner117.txt, 00_corner118.txt, 00_corner119.txt, 00_corner120.txt, 00_corner121.txt, 00_corner122.txt, 00_corner123.txt, 00_example_1.txt, 00_example_2.txt, 00_example_3.txt, 00_example_4.txt, 00_manual_001.txt, 00_manual_002.txt, 00_manual_003.txt, 00_manual_004.txt, 00_manual_005.txt, 00_small_009.txt, 00_small_010.txt, 00_small_011.txt, 00_small_012.txt, 00_small_013.txt, 00_small_014.txt, 00_small_015.txt, 00_small_016.txt, 00_small_017.txt, 00_small_018.txt, 00_small_019.txt, 00_small_020.txt, 01_random_100.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_24.txt, 01_random_25.txt, 01_random_27.txt, 01_random_29.txt, 01_random_31.txt, 01_random_34.txt, 01_random_37.txt, 01_random_39.txt, 01_random_4.txt, 01_random_41.txt, 01_random_43.txt, 01_random_45.txt, 01_random_46.txt, 01_random_47.txt, 01_random_48.txt, 01_random_5.txt, 01_random_50.txt, 01_random_51.txt, 01_random_52.txt, 01_random_54.txt, 01_random_56.txt, 01_random_57.txt, 01_random_58.txt, 01_random_59.txt, 01_random_6.txt, 01_random_60.txt, 01_random_62.txt, 01_random_65.txt, 01_random_66.txt, 01_random_68.txt, 01_random_69.txt, 01_random_7.txt, 01_random_70.txt, 01_random_72.txt, 01_random_75.txt, 01_random_76.txt, 01_random_77.txt, 01_random_79.txt, 01_random_8.txt, 01_random_80.txt, 01_random_81.txt, 01_random_82.txt, 01_random_83.txt, 01_random_84.txt, 01_random_85.txt, 01_random_87.txt, 01_random_89.txt, 01_random_9.txt, 01_random_91.txt, 01_random_92.txt, 01_random_93.txt, 01_random_94.txt, 01_random_95.txt, 01_random_96.txt, 01_random_97.txt, 01_random_98.txt, 01_random_99.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_corner100.txt | AC | 1 ms | 256 KB |
00_corner101.txt | AC | 1 ms | 256 KB |
00_corner102.txt | WA | 1 ms | 256 KB |
00_corner103.txt | AC | 1 ms | 256 KB |
00_corner104.txt | AC | 1 ms | 256 KB |
00_corner105.txt | WA | 1 ms | 256 KB |
00_corner106.txt | WA | 1 ms | 256 KB |
00_corner107.txt | WA | 1 ms | 256 KB |
00_corner108.txt | AC | 1 ms | 256 KB |
00_corner109.txt | WA | 1 ms | 256 KB |
00_corner110.txt | WA | 1 ms | 256 KB |
00_corner111.txt | AC | 1 ms | 256 KB |
00_corner112.txt | WA | 1 ms | 256 KB |
00_corner113.txt | WA | 1 ms | 256 KB |
00_corner114.txt | AC | 1 ms | 256 KB |
00_corner115.txt | WA | 1 ms | 256 KB |
00_corner116.txt | AC | 1 ms | 256 KB |
00_corner117.txt | WA | 1 ms | 256 KB |
00_corner118.txt | WA | 1 ms | 256 KB |
00_corner119.txt | AC | 1 ms | 256 KB |
00_corner120.txt | WA | 1 ms | 256 KB |
00_corner121.txt | WA | 1 ms | 256 KB |
00_corner122.txt | WA | 1 ms | 256 KB |
00_corner123.txt | WA | 1 ms | 256 KB |
00_example_1.txt | AC | 1 ms | 256 KB |
00_example_2.txt | AC | 1 ms | 256 KB |
00_example_3.txt | AC | 1 ms | 256 KB |
00_example_4.txt | AC | 1 ms | 256 KB |
00_manual_001.txt | WA | 1 ms | 256 KB |
00_manual_002.txt | AC | 1 ms | 256 KB |
00_manual_003.txt | AC | 1 ms | 256 KB |
00_manual_004.txt | AC | 1 ms | 256 KB |
00_manual_005.txt | AC | 1 ms | 256 KB |
00_small_009.txt | AC | 1 ms | 256 KB |
00_small_010.txt | WA | 1 ms | 256 KB |
00_small_011.txt | WA | 1 ms | 256 KB |
00_small_012.txt | WA | 1 ms | 256 KB |
00_small_013.txt | AC | 1 ms | 256 KB |
00_small_014.txt | AC | 1 ms | 256 KB |
00_small_015.txt | WA | 1 ms | 256 KB |
00_small_016.txt | AC | 1 ms | 256 KB |
00_small_017.txt | AC | 1 ms | 256 KB |
00_small_018.txt | AC | 1 ms | 256 KB |
00_small_019.txt | AC | 1 ms | 256 KB |
00_small_020.txt | AC | 1 ms | 256 KB |
01_random_100.txt | WA | 1 ms | 256 KB |
01_random_11.txt | AC | 1 ms | 256 KB |
01_random_12.txt | WA | 1 ms | 256 KB |
01_random_13.txt | AC | 1 ms | 256 KB |
01_random_14.txt | AC | 1 ms | 256 KB |
01_random_16.txt | AC | 1 ms | 256 KB |
01_random_17.txt | WA | 1 ms | 256 KB |
01_random_18.txt | WA | 1 ms | 256 KB |
01_random_19.txt | WA | 1 ms | 256 KB |
01_random_20.txt | WA | 1 ms | 256 KB |
01_random_21.txt | AC | 1 ms | 256 KB |
01_random_24.txt | WA | 1 ms | 256 KB |
01_random_25.txt | WA | 1 ms | 256 KB |
01_random_27.txt | AC | 1 ms | 256 KB |
01_random_29.txt | WA | 1 ms | 256 KB |
01_random_31.txt | AC | 1 ms | 256 KB |
01_random_34.txt | AC | 1 ms | 256 KB |
01_random_37.txt | WA | 1 ms | 256 KB |
01_random_39.txt | WA | 1 ms | 256 KB |
01_random_4.txt | WA | 1 ms | 256 KB |
01_random_41.txt | WA | 1 ms | 256 KB |
01_random_43.txt | WA | 1 ms | 256 KB |
01_random_45.txt | WA | 1 ms | 256 KB |
01_random_46.txt | AC | 1 ms | 256 KB |
01_random_47.txt | WA | 1 ms | 256 KB |
01_random_48.txt | WA | 1 ms | 256 KB |
01_random_5.txt | AC | 1 ms | 256 KB |
01_random_50.txt | WA | 1 ms | 256 KB |
01_random_51.txt | AC | 1 ms | 256 KB |
01_random_52.txt | WA | 1 ms | 256 KB |
01_random_54.txt | AC | 1 ms | 256 KB |
01_random_56.txt | WA | 1 ms | 256 KB |
01_random_57.txt | AC | 1 ms | 256 KB |
01_random_58.txt | WA | 1 ms | 256 KB |
01_random_59.txt | WA | 1 ms | 256 KB |
01_random_6.txt | AC | 1 ms | 256 KB |
01_random_60.txt | WA | 1 ms | 256 KB |
01_random_62.txt | WA | 1 ms | 256 KB |
01_random_65.txt | WA | 1 ms | 256 KB |
01_random_66.txt | AC | 1 ms | 256 KB |
01_random_68.txt | WA | 1 ms | 256 KB |
01_random_69.txt | WA | 1 ms | 256 KB |
01_random_7.txt | AC | 1 ms | 256 KB |
01_random_70.txt | AC | 1 ms | 256 KB |
01_random_72.txt | WA | 1 ms | 256 KB |
01_random_75.txt | WA | 1 ms | 256 KB |
01_random_76.txt | WA | 1 ms | 256 KB |
01_random_77.txt | WA | 1 ms | 256 KB |
01_random_79.txt | WA | 1 ms | 256 KB |
01_random_8.txt | AC | 1 ms | 256 KB |
01_random_80.txt | WA | 1 ms | 256 KB |
01_random_81.txt | WA | 1 ms | 256 KB |
01_random_82.txt | WA | 1 ms | 256 KB |
01_random_83.txt | WA | 1 ms | 256 KB |
01_random_84.txt | WA | 1 ms | 256 KB |
01_random_85.txt | AC | 1 ms | 256 KB |
01_random_87.txt | WA | 1 ms | 256 KB |
01_random_89.txt | WA | 1 ms | 256 KB |
01_random_9.txt | AC | 1 ms | 256 KB |
01_random_91.txt | AC | 1 ms | 256 KB |
01_random_92.txt | WA | 1 ms | 256 KB |
01_random_93.txt | AC | 1 ms | 256 KB |
01_random_94.txt | AC | 1 ms | 256 KB |
01_random_95.txt | WA | 1 ms | 256 KB |
01_random_96.txt | WA | 1 ms | 256 KB |
01_random_97.txt | WA | 1 ms | 256 KB |
01_random_98.txt | AC | 1 ms | 256 KB |
01_random_99.txt | WA | 1 ms | 256 KB |