刚刚发表声明 这是代码,
这条线究竟意味着什么? 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));
}
}
答案 0 :(得分:2)
答案 1 :(得分:0)
关键是你应该将它转换为秒,然后答案是明确的
int time1 = ((h1*60)*60)+(m1*60)+s1;
int time2 = ((h2*60)*60)+(m2*60)+s2;
int result = time2-time1;