QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#417843 | #8416. Dzielniki [B] | Qingyu | 1 ✓ | 2297ms | 4016kb | C++23 | 3.2kb | 2024-05-22 23:25:46 | 2024-05-22 23:25:48 |
Judging History
你现在查看的是测评时间为 2024-05-22 23:25:48 的历史记录
- [2024-05-22 23:53:17]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-05-22 23:52:20]
- 管理员手动重测该提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-05-22 23:25:46]
- 提交
answer
#include<bits/stdc++.h>
#include "dzilib.h"
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("trapv")
#define st first
#define nd second
#define pb push_back
#define pp pop_back
#define eb emplace_back
#define mp(a, b) make_pair(a, b)
#define all(x) (x).begin(), (x).end()
#define rev(x) reverse(all(x))
#define sor(x) sort(all(x))
#define sz(x) (int)(x).size()
#define rsz(x) resize(x)
using namespace std;
///~~~~~~~~~~~~~~~~~~~~~~~~~~
template <typename H, typename T>
ostream& operator<<(ostream& os, pair<H, T> m){
return os <<"("<< m.st<<", "<<m.nd<<")";
}
template <typename H>
ostream& operator<<(ostream& os, vector<H> V){
os<<"{";
for(int i=0; i<V.size(); i++){
if(i)os<<" ";
os<<V[i];
}
os<<"}";
return os;
}
void debug(){cerr<<"\n";}
template <typename H, typename... T>
void debug(H h, T... t) {cerr<<h; if (sizeof...(t)) cerr << ", "; debug(t...);}
#define deb(x...) cerr<<#x<<" = ";debug(x);
///~~~~~~~~~~~~~~~~~~~~~~~~~
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii > vii;
typedef vector<ll> vl;
typedef vector<pll> vll;
typedef string str;
#define BOOST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
ll los(ll a, ll b){
if(a>b)swap(a, b);
unsigned long long t=rng();
t<<=31;
t+=rng();
return a+(t%(b-a+1));
}
int ile(ll a){
return __builtin_ctzll(a);
}
/*
g++ -O3 -static -o dzi dzi.cpp dzilib.cpp -std=c++20
*/
int main() {
//deb(ile(1), ile(6),ile(4));
//return 0;
int tt = GetT();
int Q = GetQ();
long long C = GetC();
long long N = GetN();
while(tt--) {
ll x=los(0, 10*N);
ll potm=1, potM=1024;
vector<ll> V(potM);
iota(all(V), 0);
vector<pair<ll, int>> ans;
while(true){
//x=((V[0]+potm-1)/potm)*potm;
deb(ans.size());
if((V[0]+x)%potm){
ll t=(V[0]+x)%potm;
x+=potm-t;
}
ans.pb({x, Ask(x)});
x++;
//deb(ans, potm, potM, V);
vector<ll> V2;
for(ll &i:V){
int a=ile(ans.back().st+i);
//assert((1ll<<a)>=potm);
if((1ll<<a)<potM && ans.back().nd%(a+1)){
}
else V2.pb(i);
}
V=V2;
V2.clear();
//deb(V, potm, potM);
bool b=1;
for(ll &i:V){
if((i-V[0])%(2*potm)){
b=0;
}
}
if(b){
for(ll &i:V){
if(i+potM<=N)V2.pb(i+potM);
}
for(ll &i:V2)V.pb(i);
V2.clear();
//deb(V);
potm*=2;
potM*=2;
for(ll &i:V){
b=1;
for(auto &j:ans){
int a=ile(j.st+i);
if((1ll<<a)<potM && j.nd%(a+1)){
b=0;
}
}
if(b)V2.pb(i);
}
V=V2;
//assert(V.size());
}
if(V.size()==1 && potM>=N)break;
}
Answer(V[0]);
}
return 0;
}
詳細信息
Subtask #1:
score: 1
Accepted
Test #1:
score: 1
Accepted
time: 2235ms
memory: 3748kb
input:
50 100000 50000 1000000000000 49108 86361 48807 44296 98962 74228 70938 50085 85439 82491 61850 10270 86867 40660 48433 67675 57312 17321 8228 87878 61853 80754 9880 65714 55443 34797 89187 44610 75431 56726 52425 16106 49808 75351 46368 19446 65264 39323 25273 46629 98 24463 76734 54088 12393 93157...
output:
Accepted: queries used = 1274.
result:
ok
Test #2:
score: 1
Accepted
time: 2199ms
memory: 3728kb
input:
50 100000 50000 1000000000000 21469 57104 22446 74024 60004 7599 18880 42347 76178 83980 96162 67460 33521 66752 35898 60176 83640 97657 55440 58256 4483 15397 7528 42761 18012 741 45496 43216 80215 99629 62890 29063 77462 98071 27424 32544 47601 98801 53915 3299 38560 96577 24569 10735 75026 52968 ...
output:
Accepted: queries used = 1252.
result:
ok
Test #3:
score: 1
Accepted
time: 1757ms
memory: 3984kb
input:
50 100000 50000 1000000000000 11001 35509 7673 24690 15443 22930 85249 2442 65424 21223 65223 91708 37676 68800 98505 70082 53761 70029 43022 17965 67076 23681 68973 40488 84861 99396 72157 48846 77583 16679 18879 95548 8806 64669 21819 37682 33092 28505 32069 94584 11546 43718 16791 87013 95852 893...
output:
Accepted: queries used = 1269.
result:
ok
Test #4:
score: 1
Accepted
time: 2297ms
memory: 3720kb
input:
50 100000 50000 1000000000000 93976 96052 99996 98628 98776 92381 99938 91670 71221 81945 99650 78522 50592 94448 98247 97344 99997 78935 84535 99572 91874 99119 99242 79099 99678 78737 72474 99966 99297 98800 92568 96640 98771 99452 94930 98479 99024 97127 98334 85199 91969 99900 96749 97754 95988 ...
output:
Accepted: queries used = 1278.
result:
ok
Test #5:
score: 1
Accepted
time: 2056ms
memory: 3752kb
input:
50 100000 50000 1000000000000 99861 97227 99965 99800 81573 86111 95881 90856 95494 98052 92544 99501 99293 98305 93153 98858 98448 99031 98925 97265 91357 96759 99204 99930 99648 84420 99965 96328 99657 98260 79899 92365 99519 82788 96039 95438 78665 98042 99570 96899 77557 99941 88088 99276 97363 ...
output:
Accepted: queries used = 1315.
result:
ok
Test #6:
score: 1
Accepted
time: 2062ms
memory: 3832kb
input:
50 100000 50000 1000000000000 88455 98295 98552 97350 99585 94633 92948 95778 99872 99849 99749 97597 99139 92554 99317 99373 99836 97283 96490 91063 84414 88108 95620 92364 99829 95010 90394 99309 98432 99754 74609 99744 71161 81694 99966 99798 99242 98336 92819 81590 99749 98143 87421 89941 63828 ...
output:
Accepted: queries used = 1277.
result:
ok
Test #7:
score: 1
Accepted
time: 2005ms
memory: 3772kb
input:
50 100000 50000 1000000000000 98297 93305 82937 78725 73721 69977 65529 62201 59042 55289 52481 49145 46649 41465 39359 36857 34985 32761 31097 27641 26237 24569 23321 20729 19676 18425 17489 16377 15545 13817 13115 12281 11657 10361 9209 8741 8185 7769 6905 6554 6137 5825 5177 4601 4367 4089 3881 3...
output:
Accepted: queries used = 1285.
result:
ok
Test #8:
score: 1
Accepted
time: 1756ms
memory: 3856kb
input:
50 100000 50000 1000000000000 31397 31398 31396 31399 31393 31402 31388 31407 31381 31414 31372 31423 31361 31434 31348 31447 31333 31462 31316 31479 31297 31498 31276 31519 31253 31542 31228 31567 31201 31594 31172 31623 31141 31654 31108 31687 31073 31722 31036 31759 30997 31798 30956 31839 30913 ...
output:
Accepted: queries used = 1275.
result:
ok
Test #9:
score: 1
Accepted
time: 2022ms
memory: 3940kb
input:
50 100000 50000 1000000000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
output:
Accepted: queries used = 1329.
result:
ok
Test #10:
score: 1
Accepted
time: 2161ms
memory: 4016kb
input:
50 100000 50000 1000000000000 100000 99999 99998 99997 99996 99995 99994 99993 99992 99991 99990 99989 99988 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956...
output:
Accepted: queries used = 1280.
result:
ok
Subtask #2:
score: 0
Time Limit Exceeded
Test #11:
score: 0
Time Limit Exceeded
input:
50 1000000 5000 1000000000000 986587 791769 338733 959743 466876 613054 887723 862451 853797 721415 115910 736804 796748 950095 362863 419090 786887 27917 364483 289769 26581 70926 685791 12202 554610 768721 279241 297080 445667 441723 529286 230179 985659 690926 297172 606535 540585 426446 300803 5...
output:
Unauthorized output
result:
Subtask #3:
score: 0
Time Limit Exceeded
Test #21:
score: 0
Time Limit Exceeded
input:
10 1000000000 50000 1000000000000 408103384 716411227 312685147 924284703 375298759 152825423 311623701 481729457 215396950 9146195
output:
Unauthorized output
result:
Subtask #4:
score: 0
Time Limit Exceeded
Test #31:
score: 0
Time Limit Exceeded
input:
10 100000000000000 5000 100000000000000000 60077435990701 17220541740604 64191465861673 55745499051041 92001632467345 9358956369292 35872866769179 78367022100297 7839460363340 34668026591527
output:
Unauthorized output
result:
Subtask #5:
score: 0
Time Limit Exceeded
Test #41:
score: 0
Time Limit Exceeded
input:
10 100000000000000 2000 100000000000000000 12494380076190 85448577530879 31501976723503 61560401637840 9958432442859 68538788138133 81056300713749 31455642088461 52813858531796 2350217441027
output:
Unauthorized output
result:
Subtask #6:
score: 0
Time Limit Exceeded
Test #51:
score: 0
Time Limit Exceeded
input:
10 100000000000000 1300 100000000000000000 93861841503524 187801688618 12767914004896 68441979369935 44276894335941 10366130300247 10581531522622 34683620486862 71739885742802 31789387511772
output:
Unauthorized output
result:
Subtask #7:
score: 0
Time Limit Exceeded
Test #61:
score: 0
Time Limit Exceeded
input:
10 100000000000000 950 100000000000000000 89476806232027 12353673422544 87587374109960 29662216144897 59695535958606 16446701644855 15698587958167 76032905298130 18875210693225 2202458936163
output:
Unauthorized output
result:
Subtask #8:
score: 0
Time Limit Exceeded
Test #71:
score: 0
Time Limit Exceeded
input:
10 100000000000000 820 100000000000000000 57380646951677 24500445660413 52513218855562 35936833055954 21061776201610 17990465203024 53667291726216 50437972694073 8891884060027 40201586063900
output:
Unauthorized output
result:
Subtask #9:
score: 0
Time Limit Exceeded
Test #81:
score: 0
Time Limit Exceeded
input:
10 100000000000000 750 100000000000000000 5121346638871 87604132110850 89767773421324 36910678760633 22317088453717 9150554156208 86627018380188 91455697966830 39854585335842 25531102467103
output:
Unauthorized output
result:
Subtask #10:
score: 0
Time Limit Exceeded
Test #91:
score: 0
Time Limit Exceeded
input:
10 100000000000000 720 100000000000000000 32571246806419 17047845628559 72028252544868 84189424781123 34278867527450 31844169904318 25833108322349 14895620716019 41844198477918 35390870210849
output:
Unauthorized output