This commit is contained in:
Zengtudor 2024-08-09 08:12:31 +08:00
parent 35d4a9ea27
commit bd19c57854
2 changed files with 4 additions and 10 deletions

View File

@ -15,8 +15,8 @@ int l2[MAX_N];
int main(int argc,char* argv[]){ int main(int argc,char* argv[]){
#ifdef OITEST #ifdef OITEST
#define PRINT_VALUE(v){cout<<#v<<" :"<<(v)<<endl;} // #define PRINT_VALUE(v){cout<<#v<<" :"<<(v)<<endl;}
PRINT_VALUE(argv[0]) // PRINT_VALUE(argv[0])
string fileName="perfect"; string fileName="perfect";
assert(argc==2); assert(argc==2);
string num(argv[1]); string num(argv[1]);
@ -52,10 +52,6 @@ int main(int argc,char* argv[]){
for(int l=1;l<=n;l++){ for(int l=1;l<=n;l++){
for(int r=l;r<=n;r++){ for(int r=l;r<=n;r++){
int j=l2[r-l+1]; int j=l2[r-l+1];
PRINT_VALUE(l)
PRINT_VALUE(r)
PRINT_VALUE(r-(1<<j)+1)
PRINT_VALUE(j);
int maxlr=max(sMax[l][j],sMax[r-(1<<j)+1][j]); int maxlr=max(sMax[l][j],sMax[r-(1<<j)+1][j]);
int minlr=min(sMin[l][j],sMin[r-(1<<j)+1][j]); int minlr=min(sMin[l][j],sMin[r-(1<<j)+1][j]);
ans=max(ans,maxlr^minlr); ans=max(ans,maxlr^minlr);
@ -63,8 +59,6 @@ int main(int argc,char* argv[]){
} }
cout<<ans<<endl; cout<<ans<<endl;
#ifdef OITEST #ifdef OITEST
PRINT_VALUE(ans);
PRINT_VALUE(correctAns);
assert(ans==correctAns); assert(ans==correctAns);
#endif #endif
} }

View File

@ -29,9 +29,9 @@ target("fperfect")
set_kind("binary") set_kind("binary")
add_files("./day5/perfect/fix.cpp") add_files("./day5/perfect/fix.cpp")
set_rundir("./day5/perfect/") set_rundir("./day5/perfect/")
for val=1,4 do for val=1,4 do --test 3,4
local strval = tostring(val) local strval = tostring(val)
add_tests(strval,{files="./day5/perfect/fix.cpp",defines="OITEST",runargs=strval,run_timeout=1000}) add_tests(strval,{files="./day5/perfect/fix.cpp",defines="OITEST",runargs=strval,run_timeout=2000})
end end
target("pre88") target("pre88")