結果
| 問題 | No.3633 Rabbit and turtle |
| コンテスト | |
| ユーザー |
pengin_2000
|
| 提出日時 | 2026-09-03 20:50:34 |
| 言語 | C (gcc 15.3.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 481 bytes |
| 記録 | |
| コンパイル時間 | 1,419 ms |
| コンパイル使用メモリ | 35,968 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-09-03 20:50:42 |
| 合計ジャッジ時間 | 3,016 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 15 |
ソースコード
#include<stdio.h>
void solve()
{
long long int a, b, d, r;
scanf("%lld %lld %lld %lld", &a, &b, &d, &r);
b *= (d + r - 1) / r + 1;
if (a > b)
printf("rabbit\n");
else if (a < b)
printf("turtle\n");
else
{
long long int c = (d + r - 1) / r + 1;
while (c % 2 == 0)
c /= 2;
while (c % 5 == 0)
c /= 5;
if (c > 1)
printf("rabbit\n");
else
printf("tie\n");
}
return;
}
int main()
{
int t;
scanf("%d", &t);
for (; t > 0; t--)
solve();
return 0;
}
pengin_2000