QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#108758 | #6389. Topical | cyan17# | 33 | 209ms | 19348kb | C++17 | 2.4kb | 2023-05-26 16:50:46 | 2024-05-31 13:42:46 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define fr first
#define sc second
#define eb emplace_back
const char nl = '\n';
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << "LINE(" << __LINE__ << ") -> " <<"[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, k; cin >> n >> k;
/* int r[n + 1][k + 1], u[n + 1][k + 1]; */
/* for(int i = 1; i <= n; ++i) { */
/* for(int j = 1; j <= k; ++j) { */
/* cin >> r[i][j]; */
/* } */
/* } */
/* for(int i = 1; i <= n; ++i) { */
/* for(int j = 1; j <= k; ++j) { */
/* cin >> u[i][j]; */
/* } */
/* } */
/* int p[k + 1] = {}; */
/* for(int i = 1; i <= k; ++i) { */
/* if(r[1][i] > p[i]) { */
/* cout << 0; */
/* return 0; */
/* } */
/* } */
/* cout << 1; */
pair<int, int> mod[n + 1];
for(int i = 1; i <= n; ++i) cin >> mod[i].fr;
for(int i = 1; i <= n; ++i) cin >> mod[i].sc;
sort(mod + 1, mod + n + 1);
/* for(int i = 1; i<= n; ++i) { */
/* cout << mod[i].fr << ' ' << mod[i].sc << nl; */
/* } */
/* cout << nl; */
int p = 0;
for(int i = 1; i <= n; ++i) {
if(p < mod[i].fr) {
cout << i - 1;
return 0;
}
p += mod[i].sc;
}
cout << n;
return 0;
}
详细
Subtask #1:
score: 12
Accepted
Test #1:
score: 12
Accepted
time: 0ms
memory: 3688kb
input:
1 1 693647287 340782526
output:
0
result:
ok 1 number(s): "0"
Test #2:
score: 12
Accepted
time: 1ms
memory: 3728kb
input:
1 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 279985824 991797187 998715443 98505529 106002744 636773096 815089164 196160830 796988849 87975...
output:
1
result:
ok 1 number(s): "1"
Test #3:
score: 12
Accepted
time: 0ms
memory: 3620kb
input:
1 10000 841961872 0 0 0 0 0 0 0 0 0 0 0 0 0 831386430 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 205210920 705123207 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 276768098 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 661649446 0 0 0 0 0 0 0 0 0 0 ...
output:
0
result:
ok 1 number(s): "0"
Test #4:
score: 12
Accepted
time: 1ms
memory: 3736kb
input:
1 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: 12
Accepted
time: 0ms
memory: 3548kb
input:
1 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
1
result:
ok 1 number(s): "1"
Test #6:
score: 12
Accepted
time: 1ms
memory: 3724kb
input:
1 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
1
result:
ok 1 number(s): "1"
Test #7:
score: 12
Accepted
time: 0ms
memory: 3740kb
input:
1 1000000 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 10...
output:
0
result:
ok 1 number(s): "0"
Subtask #2:
score: 0
Wrong Answer
Test #8:
score: 28
Accepted
time: 0ms
memory: 3680kb
input:
100 1 893339036 896783899 690308537 201770764 262364362 105000893 770698921 744238454 470980016 935046317 642998516 100481910 392307650 116783134 196939768 372329082 346372520 43063564 245523488 389084350 130314590 412588681 987795927 681635353 304582580 472268968 700147283 743357606 792644412 99955...
output:
85
result:
ok 1 number(s): "85"
Test #9:
score: 0
Wrong Answer
time: 0ms
memory: 3548kb
input:
100 100 1000000000 828788913 1000000000 894501902 1000000000 898513761 837197514 865900986 809812226 853486369 848261509 888902562 1000000000 881898651 932777249 907237990 892103882 1000000000 870206141 1000000000 776016734 1000000000 889438568 856689807 887799348 859324346 872070680 879391131 10000...
output:
0
result:
wrong answer 1st numbers differ - expected: '52', found: '0'
Subtask #3:
score: 21
Accepted
Test #15:
score: 21
Accepted
time: 2ms
memory: 3832kb
input:
10000 1 568857328 651788426 751475430 102940442 763289419 468657944 770847628 780257867 16919385 575963868 281824241 291248174 140016533 313529232 302186452 32709864 787073783 1926820 239509174 220454071 34252400 390385721 675239026 245106357 489697460 28435096 825528061 159083009 16370561 223299279...
output:
10000
result:
ok 1 number(s): "10000"
Test #16:
score: 21
Accepted
time: 20ms
memory: 5300kb
input:
100000 1 78763439 671847244 661890823 215179284 804182046 667280820 140277780 822235648 809998506 39559747 459311656 212179350 227573276 606854131 182676019 61302123 281509402 53785090 106827674 911115512 31998233 678388767 75425082 154920343 882021740 976962371 219500493 609794633 780392857 6696241...
output:
68284
result:
ok 1 number(s): "68284"
Test #17:
score: 21
Accepted
time: 18ms
memory: 5216kb
input:
100000 1 25138355 17042043 1791957 6455298 6022262 943678542 14813410 711168650 249633996 3186950 16632667 24001382 2843444 25153901 570090758 3077367 2314262 26140773 17228102 497847556 12294116 18909179 422337291 16067561 259209280 289237264 25047202 160449968 12519857 1244368 11282595 29145099 82...
output:
68282
result:
ok 1 number(s): "68282"
Test #18:
score: 21
Accepted
time: 209ms
memory: 19348kb
input:
1000000 1 799588087 822681913 254545397 97351630 427025189 658494837 651864977 636227655 1000000000 421118974 131934476 789087487 271663521 77040834 306682621 23246800 1000000000 4080691 114988214 1000000000 152635014 288639494 200342229 407473872 336259342 490398961 1000000000 21149811 32578493 100...
output:
1000000
result:
ok 1 number(s): "1000000"
Test #19:
score: 21
Accepted
time: 183ms
memory: 19280kb
input:
1000000 1 285376023 139701461 759149436 338563243 968059592 91064260 200562697 294820886 259550266 299285061 322691459 998705676 208944881 841078516 89430704 14548712 108680769 300057128 632999611 730925777 602763167 365431973 31822063 253511251 229737836 323612130 46929299 114782466 120813050 43248...
output:
830576
result:
ok 1 number(s): "830576"
Test #20:
score: 21
Accepted
time: 197ms
memory: 19244kb
input:
1000000 1 799588087 822681913 254545397 97351630 427025189 658494837 651864977 636227655 1000000000 421118974 131934476 789087487 271663521 77040834 306682621 23246800 1000000000 4080691 114988214 1000000000 152635014 288639494 200342229 407473872 336259342 490398961 1000000000 21149811 32578493 100...
output:
1000000
result:
ok 1 number(s): "1000000"
Test #21:
score: 21
Accepted
time: 185ms
memory: 19280kb
input:
1000000 1 285376023 139701461 759149436 338563243 968059592 91064260 200562697 294820886 259550266 299285061 322691459 998705676 208944881 841078516 89430704 14548712 108680769 300057128 632999611 730925777 602763167 365431973 31822063 253511251 229737836 323612130 46929299 114782466 120813050 43248...
output:
830576
result:
ok 1 number(s): "830576"
Subtask #4:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%