QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#560623 | #3953. Jane Eyre | LaVuna47# | RE | 0ms | 3592kb | C++17 | 3.1kb | 2024-09-12 17:00:58 | 2024-09-12 17:00:58 |
Judging History
answer
/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, n) for(int i = 0; i < n; ++i)
#define RFOR(i, n) for(int i = n-1; i >= 0; --i)
#define output_vec(vec) { FOR(i_, sz(vec)) cout << vec[i_] << ' '; cout << '\n'; }
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<bool> vb;
typedef short si;
typedef unsigned long long ull;
typedef long double LD;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif
int solve()
{
int n, m, k;
if (!(cin >> n >> m >> k))
return 1;
ll ans = 0;
//set<pair<string, int>> s;
//s.insert(make_pair("\"Jane Eyre\"", k));
FOR (i, n)
{
string full = "";
string tmp;
cin >> tmp;
int cnt = 0;
while (tmp.back() != '\"')
{
full += tmp;
cin >> tmp;
cnt++;
assert(cnt <= 20);
}
full += tmp;
int pages;
cin >> pages;
if (full < "\"Jane Eyre\"")
{
//s.insert(make_pair(full, pages));
ans += pages;
}
}
vector<pair<ll, pair<string, int>>> gg;
FOR (i, m)
{
ll time;
cin >> time;
string full = "";
string tmp;
cin >> tmp;
int cnt = 0;
while (tmp.back() != '\"')
{
full += tmp;
cin >> tmp;
cnt++;
assert(cnt <= 20);
}
full += tmp;
int pages;
cin >> pages;
if (full < "\"Jane Eyre\"")
{
pair<ll, pair<string, int>> curr;
curr.x = time;
curr.y.x = full;
curr.y.y = pages;
gg.pb(curr);
}
}
int j = 0;
while (j < sz(gg))
{
if (gg[j].x <= ans)
{
ans += gg[j].y.y;
j++;
}
else
break;
}
ans += k;
cout << ans << '\n';
return 0;
}
int32_t main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int TET = 1;
//cin >> TET;
for (int i = 1; i <= TET; i++)
{
if (solve())
{
break;
}
#ifdef ONPC
cout << "__________________________" << endl;
#endif
}
#ifdef ONPC
cerr << endl << "finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec" << endl;
#endif
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3592kb
input:
2 2 592 "Pride and Predjudice" 432 "Don Quixote" 863 863 "Great Gatsby" 218 1082 "Crime and Punishment" 545
output:
1673
result:
ok single line: '1673'
Test #2:
score: -100
Runtime Error
input:
10 10 50116 "0sHzkZ q jriAgwD3WXL" 72225 "r6QBE1wVEmZiM0tY Nnb" 66075 "I6P vym0M DntAv83NeD" 2926 "EJKCvB958OXibIVU6V8b" 59599 "Bm1sD2u 3i32wbCrMXbP" 97406 "l DyFdoVV 3BZ3pijw8A" 50291 "v s2v2DofsHcQ1GdJJdc" 97497 " s Yca oEz5prWklLuN" 21457 "CfpaCUZfRhs18Mmi 4IF" 11100 " yODdnhrY7N60tC2CoSE" 94220...