QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#561980 | #1983. Cakes | V-ioleT | AC ✓ | 1ms | 3720kb | C++20 | 933b | 2024-09-13 13:57:39 | 2024-09-13 13:57:40 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define ull unsigned long long
typedef long long ll;
#define lowbit(x) ((x) & -(x))
const ll INF = 0x3f3f3f3f;
const ll mod = 998244353;
const int N = 1e6 + 5, M = 5e5 + 10;
typedef pair<int, int> PII;
double T = 1 >> 30;
// double PI = acos(-1);
int gcd(int a, int b)
{
return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b)
{
return a / gcd(a, b) * b;
}
void solve()
{
int i, j;
int n;
cin >> n;
int ans = 100000;
for (i = 1; i <= n;i++)
{
int x, y;
cin >> x >> y;
ans = min(ans, y / x);
}
cout << ans;
}
signed main()
{
// ios_base::sync_with_stdio(false);
// cin.tie(nullptr);
// cout.tie(nullptr);
int t = 1;
// cin >> t;
while (t--)
{
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3708kb
input:
1 1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
2 1 5000 5 10000
output:
2000
result:
ok single line: '2000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
2 1 5000 6 10000
output:
1666
result:
ok single line: '1666'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
10 173 1561 416 3733 449 3063 1207 7353 520 3024 910 6063 687 4589 1779 9402 1115 5874 819 5083
output:
5
result:
ok single line: '5'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
10 336 3217 923 6730 568 5620 154 1446 1069 9055 976 5941 561 3259 474 3121 983 7153 739 4827
output:
5
result:
ok single line: '5'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
10 660 5741 983 9463 518 4992 1096 9177 713 6122 509 3658 463 3259 242 2284 195 1609 1130 8178
output:
7
result:
ok single line: '7'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
10 2 2815 1 1438 3 4158 5 6799 5 6638 3 5753 5 9420 2 4404 1 2165 1 2136
output:
1327
result:
ok single line: '1327'