#21298: 為什麼會TLE


abs71507@gmail.com (46 5)

學校 : 國立中興大學
編號 : 87742
來源 : [36.235.200.136]
最後登入時間 :
2023-05-24 14:06:42
e286. 籃球比賽 -- APCS | From: [110.50.141.70] | 發表日期 : 2020-05-13 19:30

#include <iostream>

using namespace std;

int main(void)

{

ios_base::sync_with_stdio(false);

cin.tie(0);

short in,a_1=0,b_1=0,a_2=0,b_2=0;

while (true)

{

for (int i = 0; i < 4; i++) { cin >> in; a_1 += in; }

for (int i = 0; i < 4; i++) { cin >> in; b_1 += in; }

cout << a_1 << ":" << b_1 << endl;

for (int i = 0; i < 4; i++) { cin >> in; a_2 += in; }

for (int i = 0; i < 4; i++) { cin >> in; b_2 += in; }

cout << a_1 << ":" << b_1 << endl;

if (a_1>b_1&&a_2>b_2)

cout << "Win" << endl;

else if (a_1<b_1&&a_2<b_2)

cout << "Lose" << endl;

else

cout << "Tie" << endl;

}

return 0;

}

 
ZeroJudge Forum