QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#227760#2944. Transporting SpaghettiThallium54#WA 1ms3524kbC++20703b2023-10-27 22:43:002023-10-27 22:43:01

Judging History

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

  • [2023-10-27 22:43:01]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3524kb
  • [2023-10-27 22:43:00]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;
 
typedef long long int ll;
typedef long double ld;
#define f first
#define s second
#define pb push_back
#define pii pair<int, int>

 
const int N = 2e5 + 100;
const int inf = 1e9;
const ll mod =  998244353;




int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    for (int i = 1; i <= 1000; i++) {
        int tot = i * a;
        if (tot >= c + d) {
            int rem = tot - d;
            if (rem % b == 0) {
                cout << "We need " << i << " trucks and " << rem / b <<  " boats.\n";
                return 0;
            }
        }
    }

    cout << "No solution.\n";
    return 0;
}


詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3360kb

input:

31 13 50 28

output:

We need 3 trucks and 5 boats.

result:

ok single line: 'We need 3 trucks and 5 boats.'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3392kb

input:

100 20 30 10

output:

No solution.

result:

ok single line: 'No solution.'

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3524kb

input:

1 1 1 100

output:

We need 101 trucks and 1 boats.

result:

wrong answer 1st lines differ - expected: 'We need 101 trucks and 1 boat.', found: 'We need 101 trucks and 1 boats.'