There were 14 wrong times in the field race.
。
。。。
Comparison of Android versionsTime limit:2000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): Accepted submission (s): 60
Problem Descriptionas an Android developer, Itˇs really isn't easy-to-figure out a newer version of the kernels, because and Roid are updated so frequently and have many branches. Fortunately, Google identifies individual builds with a short build code, e.g. frf85b.
The first letter is the code name of the release family, e.g. F is Froyo. The code names is ordered alphabetically. The latest code name is K (KitKat).
The second letter are a branch code that allows Google to identify the exact code branch that the build were made from, and R is by convention the primary release branch.
The next letter and the digits is a date code. The letter counts quarters, with A being Q1 2009. Therefore, F is Q2 2010. The digits count days within the quarter, so F85 is June 24 2010.
Finally, the last letter identifies individual versions related to the same date code, sequentially starting with A; A is actually implicit and usually omitted for brevity.
Please develop a compare the Android build numbers.
Inputthe first line is a integer n (1 <= n <=), which indicates how many test cases need to process.
Each of the test case consists of a is a single line containing the build numbers, separated by a space character.
Outputfor each test case, output A, starting with¨case #:〃 (# means the number of the the test case). Then, output the result of release comparison as follows:
Print "<" If the release of the first build number is lower than the second one;
Print "=" If the release of the first build number is same as he second one;
Print ">" If the release of the first build number is higher than the second one.
Continue to output the result of date comparison as follows:
Print "<" if the date of the first build number is lower than the second one;
Print "=" If the date of the first build number is same as he second one;
Print ">" If the date of the first build number is higher than the second one.
If the builds is not in the same Code branch, just compare the date code; If they is in the same Code branch, compare the date code together with the individual version.
Sample Input
2frf85b epf21bktu84l ktu84m
Sample Output
Case 1: > >case 2: = <
Source
Field=problem&key=2014%c9%cf%ba%a3%c8%ab%b9%fa%d1%fb%c7%eb%c8%fc%a1%aa%a1%aa%cc%e2%c4%bf%d6%d8%cf%d6%a3%a8 %b8%d0%d0%bb%c9%cf%ba%a3%b4%f3%d1%a7%cc%e1%b9%a9%cc%e2%c4%bf%a3%a9&source=1&searchmode=source "Style=" Color:rgb (26,92,200); Text-decoration:none ">2014 Shanghai National Invitational--the title reappears (thanks to Shanghai University for providing topics)
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm>using namespace Std;char S1[10],s2[10];char one,two;void BJ1 () {if (s1[0]<s2[0]) one= ' < '; else if (s1[0]==s2[0]) one= ' = '; else one= ' > ';} void BJ2 () {if (s1[2]<s2[2]) two= ' < '; else if (s1[2]==s2[2]) {int day1= (s1[3]-' 0 ') *10+s1[4]-' 0 '; int day2= (s2[3]-' 0 ') *10+s2[4]-' 0 '; if (day1<day2) two= ' < '; else if (day1==day2) {if (s1[1]==s2[1]) {if (s1[5]<s2[5]) two= ' < '; else if (s1[5]==s2[5]) two= ' = '; else two= ' > '; } else two= ' = '; } else two= ' > '; } else two= ' > ';} int main () {int t_t; int Cas=1; scanf ("%d", &t_t); while (t_t--) {scanf ("%s%s", S1,S2); if (strlen (S1) <6) s1[5]= ' A '; if (strlen (S2) <6) s2[5]= ' A '; BJ1 (); BJ2 (); printf ("Case%d:%c%c\n", cas++,one,two); } return 0;}
Hdoj 5099 Comparison of Android versions pit title