pre88
This commit is contained in:
parent
1196f9d2a1
commit
a03cea7984
28
day5/perfect/fix.cpp
Normal file
28
day5/perfect/fix.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
const int MAX_N = 3e5+5;
|
||||
const int MAX_K = 19;
|
||||
int sMin[MAX_N][MAX_K];
|
||||
int sMax[MAX_N][MAX_K];
|
||||
int l[MAX_N];
|
||||
|
||||
|
||||
int main(){
|
||||
cin.sync_with_stdio(false);
|
||||
cin.tie(0);
|
||||
l[1]=0;
|
||||
int n;
|
||||
cin>>n;
|
||||
for(int i=1;i<=n;i++){
|
||||
cin>>sMin[i][0];
|
||||
sMax[i][0]=sMin[i][0];
|
||||
if(i!=1)l[i]=l[(i>>1)]+1;
|
||||
}
|
||||
int k=l[n]+1;
|
||||
for(int j=1;j<=k;j++){
|
||||
for(int i=1;i+(1<<j)-1<=n;i++){
|
||||
sMax[i][j]=max(sMax[i][j-1],sMax[i+(1<<(j-1))][j-1]);
|
||||
}
|
||||
}
|
||||
}
|
BIN
day6/CSP-S1 模拟赛.pdf
Normal file
BIN
day6/CSP-S1 模拟赛.pdf
Normal file
Binary file not shown.
@ -27,9 +27,7 @@ signed main(){
|
||||
#endif
|
||||
|
||||
#ifdef ISTEST
|
||||
#define assertr(e){if(!(e)){cerr<<"error on "<<#e<<" :"<<"False"<<endl;return -1;}else{cout<<#e<<" Passed OK!";}}
|
||||
|
||||
int main(){
|
||||
assertr(binExp(2, 10, 9)==7);
|
||||
assert(binExp(2, 10, 9)==7);
|
||||
}
|
||||
#endif
|
23
day6/pre88/pre88.cpp
Normal file
23
day6/pre88/pre88.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
string s1,s2,s3,s4,s5,s6;
|
||||
|
||||
/*
|
||||
1.B 2.B
|
||||
|
||||
*/
|
||||
|
||||
int main() {
|
||||
s1 = "ABCDABCDABCDABC";
|
||||
s2 = "TFTFAB";
|
||||
s3 = "TFTABC";
|
||||
s4 = "TFTABC";
|
||||
s5 = "ABCDA";
|
||||
s6 = "ABCDA";
|
||||
|
||||
string ans = s1 + s2 + s3 + s4 + s5 + s6;
|
||||
assert(ans.length() == 43);
|
||||
cout<<ans;
|
||||
return 0;
|
||||
}
|
11
xmake.lua
11
xmake.lua
@ -23,4 +23,13 @@ target("P3865")
|
||||
target("binExp")
|
||||
set_kind("binary")
|
||||
add_files("./day6/binaryExponentiation/*.cpp")
|
||||
add_tests("binExp",{files="./day6/binaryExponentiation/*.cpp",defines = "ISTEST"})
|
||||
add_tests("binExp",{files="./day6/binaryExponentiation/*.cpp",defines = "ISTEST"})
|
||||
|
||||
target("fperfect")
|
||||
set_kind("binary")
|
||||
add_files("./day5/perfect/fix.cpp")
|
||||
add_tests("fperfect",{files="././day5/perfect/fix.cpp",defines="OITEST"})
|
||||
|
||||
target("pre88")
|
||||
set_kind("binary")
|
||||
add_files("./day6/pre88/*.cpp")
|
Loading…
Reference in New Issue
Block a user