QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#227760 | #2944. Transporting Spaghetti | Thallium54# | WA | 1ms | 3524kb | C++20 | 703b | 2023-10-27 22:43:00 | 2023-10-27 22:43:01 |
Judging History
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.'