QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#322373 | #6773. True Story | PetroTarnavskyi# | WA | 41ms | 8852kb | C++20 | 1.1kb | 2024-02-06 22:30:28 | 2024-02-06 22:30:28 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); i--)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout << fixed << setprecision(15);
int n, k, x;
cin >> n >> k >> x;
VI t(k + 1), p(k + 1);
t[0] = 0;
cin >> p[0];
VI s(n);
FOR(i, 0, n)
cin >> s[i];
FOR(i, 0, k)
cin >> t[i + 1];
FOR(i, 0, k)
cin >> p[i + 1];
int ans = 0;
set<PII> SS;
FOR(i, 0, n)
SS.insert(MP(s[i], i));
FOR(i, 0, k + 1)
{
int nS = (x + p[i] - t[i] - 1) / (p[i] - t[i]);
while(SZ(SS) && SS.rbegin()->F >= nS)
{
int S = SS.rbegin()->F;
SS.erase(prev(SS.end()));
if((p[k] - t[i]) * S >= x)
ans++;
}
}
cout << ans << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3580kb
input:
4 3 10 4 1 5 2 1 3 4 5 7 9 10
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
1 3 10 3 1 2 3 4 5 8 10
output:
0
result:
ok single line: '0'
Test #3:
score: -100
Wrong Answer
time: 41ms
memory: 8852kb
input:
100000 100000 544857367 2 45337851 26009328 15109007 11351428 108994261 7849241 17594424 49523907 45417024 54467076 60475979 54550753 30367925 22635509 272520858 49488818 90740887 32100499 21719978 20217697 22756760 32141867 23665455 90791528 30224242 21821163 23727178 13022129 30321908 21859760 341...
output:
37330
result:
wrong answer 1st lines differ - expected: '100000', found: '37330'