結果
| 問題 |
No.8099 夜の道路は気をつけて運転しなければならない
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-31 23:29:20 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,257 bytes |
| コンパイル時間 | 1,989 ms |
| コンパイル使用メモリ | 194,480 KB |
| 最終ジャッジ日時 | 2025-02-11 21:56:44 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 WA * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using ui64 = uint64_t;
#ifdef LOCAL_DEBUG
#define debug(X) std::cerr << X << " "
#define debugV(X) std::cerr << #X << " = " << X << ", "
#define debugVL(Y) std::cerr << #Y << " = " << Y << '\n'
#define debugWL(Z) std::cerr << #Z << '\n'
#define debugP() std::cerr << "Line:" << __LINE__ << '\n'
#else
#define debug(X)
#define debugV(X)
#define debugVL(Y)
#define debugWL(Z)
#define debugP()
#endif
int main() {
cout << setprecision(17);
i64 T, iS, iD;
cin >> T >> iS >> iD;
double S = iS, D = iD;
i64 itime = iD/iS;
double dtime = D/S;
bool isInt = false;
i64 yoruTime = 0;
if(iD % iS == 0){
isInt = true;
itime = iD/iS;
}
if(isInt){
debugWL(is int);
yoruTime += (itime / 24)*12;
itime %= 24;
dtime = itime;
}
else{
yoruTime += ((int)dtime / 24)*(12);
while(24 <= dtime){
dtime -= 24.0;
}
}
double ans = yoruTime;
yoruTime = 0;
debugV(itime);
debugVL(dtime);
if(T < 6){
debugP();
while(T < 6){
yoruTime++;
T++;
}
}
else if(18 <= T){
debugP();
int cnt = 0;
while(T < 24){
yoruTime++;
T++;
}
T = 0;
while(T < 6){
yoruTime++;
T++;
}
}
else{
debugP();
int cnt = 0;
while(T < 18){
if(cnt >= (int)dtime){
break;
}
cnt++;
T++;
}
while(T < 24){
if(cnt >= (int)dtime){
break;
}
cnt++;
yoruTime++;
T++;
}
T = 0;
while(T < 6){
if(cnt >= (int)dtime){
break;
}
cnt++;
yoruTime++;
T++;
}
}
debugVL(yoruTime);
debugV(itime);
debugVL(dtime);
if(isInt){
debugP();
ans += min(yoruTime, itime);
}
else{
debugP();
ans += min((double)yoruTime, dtime);
}
cout << ans << endl;
}