QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#667925#9296. Golden Spirit4eyebird#RE 0ms0kbC++17796b2024-10-23 09:48:082024-10-23 09:48:16

Judging History

你现在查看的是最新测评结果

  • [2024-10-23 09:48:16]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-10-23 09:48:08]
  • 提交

answer

#include <iostream>


using namespace std;

#define Buff ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define int long long


void solve()
{
    int n, x, t;
    cin >> n >> x >> t;
    int ans = 0;
    ans += n * t * 2;
    if (ans - 2 * t >= x)
        ans += n * t * 2;
    else
    {
        int ans2 = ans;
        ans += n * t * 2 + (x - (ans - 2 * t));
        ans2 += t;
        if (ans2 >= x)
            ans2 += n * t * 2;
        else
            ans2 += n * t * 2 + (x - ans2);
        ans = min(ans, ans2);
    }
    cout << ans << '\n';
}

signed main()
{
    freopen("in.txt","r",stdin);
    freopen("out.txt", "w", stdout);
    Buff;
    int _T_ = 1;
    cin >> _T_;
    while (_T_--)
        solve();
    return 0;
}

详细

Test #1:

score: 0
Dangerous Syscalls

input:

3
2 2 2
3 1 10
11 45 14

output:


result: