#18720: WA(line:3)


gngn15401@gmail.com (冰箱)

學校 : 不指定學校
編號 : 98199
來源 : [123.194.13.42]
最後登入時間 :
2021-08-25 01:43:08
b572. 忘了東西的傑克 -- 板橋高中練習題 | From: [110.50.172.200] | 發表日期 : 2019-07-31 14:41

#include <iostream>
using namespace std;
int main(){
int n;
while (cin >>n){
for (int i=0;i<n;i++){
int h1,m1,h2,m2,t;
cin >>h1 >>m1 >>h2 >>m2 >>t;
if (h1==h2){
if (m1+t>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
if (m1+t>60){
int m3=m1+t;
for (m3;m3>=60;m3=m3-60){
h1+=1;
}
if (h1>h2){
cout <<"No" <<endl;
}else if (h1==h2){
if (m3>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
cout <<"Yes" <<endl;
}
}
}
}
}
return 0;
}

 

請問我哪裡有寫錯

 
#18723: Re:WA(line:3)


rexwu1104@gmail.com (黑雪公主 Black Lotus)

學校 : 新北市私立南山高級中學
編號 : 93041
來源 : [118.166.54.130]
最後登入時間 :
2022-06-06 20:48:09
b572. 忘了東西的傑克 -- 板橋高中練習題 | From: [36.224.132.243] | 發表日期 : 2019-07-31 20:36

#include
using namespace std;
int main(){
int n;
while (cin >>n){
for (int i=0;i<n;i++){
int h1,m1,h2,m2,t;
cin >>h1 >>m1 >>h2 >>m2 >>t;
if (h1==h2){
if (m1+t>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
if (m1+t>60){
int m3=m1+t;
for (m3;m3>=60;m3=m3-60){
h1+=1;
}
if (h1>h2){
cout <<"No" <<endl;
}else if (h1==h2){
if (m3>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
cout <<"Yes" <<endl;
}
}
}
}
}
return 0;
}

 

請問我哪裡有寫錯

為什麼不直接乘


 
#18762: Re:WA(line:3)


gngn15401@gmail.com (冰箱)

學校 : 不指定學校
編號 : 98199
來源 : [123.194.13.42]
最後登入時間 :
2021-08-25 01:43:08
b572. 忘了東西的傑克 -- 板橋高中練習題 | From: [111.246.71.104] | 發表日期 : 2019-08-04 23:37

#include
using namespace std;
int main(){
int n;
while (cin >>n){
for (int i=0;i<n;i++){
int h1,m1,h2,m2,t;
cin >>h1 >>m1 >>h2 >>m2 >>t;
if (h1==h2){
if (m1+t>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
if (m1+t>60){
int m3=m1+t;
for (m3;m3>=60;m3=m3-60){
h1+=1;
}
if (h1>h2){
cout <<"No" <<endl;
}else if (h1==h2){
if (m3>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
cout <<"Yes" <<endl;
}
}
}
}
}
return 0;
}

 

請問我哪裡有寫錯

為什麼不直接乘


想說試試其他的ww


 
#24833: Re:WA(line:3)


andrew99154 (YuCheng)

學校 : 均一國際教育實驗高級中學
編號 : 145338
來源 : [111.254.45.176]
最後登入時間 :
2024-01-03 20:33:30
b572. 忘了東西的傑克 -- 板橋高中練習題 | From: [36.236.160.157] | 發表日期 : 2021-03-28 21:46

#include
using namespace std;
int main(){
int n;
while (cin >>n){
for (int i=0;i<n;i++){
int h1,m1,h2,m2,t;
cin >>h1 >>m1 >>h2 >>m2 >>t;
if (h1==h2){
if (m1+t>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
if (m1+t>60){
int m3=m1+t;
for (m3;m3>=60;m3=m3-60){
h1+=1;
}
if (h1>h2){
cout <<"No" <<endl;
}else if (h1==h2){
if (m3>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
cout <<"Yes" <<endl;
}
}
}
}
}
return 0;
}

 

請問我哪裡有寫錯

為什麼不直接乘


想說試試其他的ww


判斷時用 >=,用>會WA

 
ZeroJudge Forum