Reputation: 45
just came through a statement in this is the code,,
what exactly does this line mean..? timeO >?= timeB;
using namespace std;
int main() {
int tt = 0;
int T; scanf("%d",&T); while (T--) {tt++;
int N; scanf("%d",&N);
int posO = 1, timeO = 0;
int posB = 1, timeB = 0;
char type[2]; int M;
for (int i=0; i<N; i++) {
scanf("%s %d",type,&M);
if (type[0]=='O') {
timeO += abs(M-posO);
timeO >?= timeB;
timeO++;
posO = M;
} else {
timeB += abs(M-posB);
timeB >?= timeO;
timeB++;
posB = M;
}
}
printf("Case #%d: %d\n",tt,max(timeO,timeB));
}
}
Upvotes: 0
Views: 215
Reputation: 1401
the point is you should convert it to second then the answer is clear
int time1 = ((h1*60)*60)+(m1*60)+s1;
int time2 = ((h2*60)*60)+(m2*60)+s2;
int result = time2-time1;
Upvotes: 0
Reputation: 206775
It's an old GCC extension Minimum and Maximum Operators in C++.
(Doesn't build with GCC 4.5 or above.)
Don't use it, it's not portable at all.
Upvotes: 2