learn inverse

This commit is contained in:
Zengtudor 2024-08-09 09:07:47 +08:00
parent bd19c57854
commit c2c24ea8b8
7 changed files with 31 additions and 5 deletions

View File

@ -79,6 +79,10 @@ ll ksm(ll a,ll b,ll M){
## T9 ## T9
1. 先与后或先&后| 1. 先与后或先&后|
## Day7
### 离线算法和在线算法
>有预处理和没有预处理的区别
# 排序 # 排序
## 稳定性 ## 稳定性
>隔着老远swap一般不稳定 >隔着老远swap一般不稳定

View File

@ -13,7 +13,6 @@ int l2[MAX_N];
#endif #endif
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])

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,28 @@
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
#define int long long
int main(){
cout<<(8>>1)<<endl;
signed main(){
int b,e,m;
#ifdef OITEST
b=2;e=10;m=9;
#endif
#ifndef OITEST
cin>>b>>e>>m;
#endif
int r=1;
while(e>0){
if (e%2==1) {
r=(r*b)%m;
}
e=(e>>1);
b=(b*b)%m;
}
cout<<r<<endl;
#ifdef OITEST
assert(r==7);
#endif
} }

View File

@ -14,7 +14,8 @@ target("st_done")
target("test") target("test")
set_kind("binary") set_kind("binary")
add_files("test.cpp") add_files("./test.cpp")
add_tests("1",{files="./test.cpp",defines="OITEST",run_timeout=1000})
target("P3865") target("P3865")
set_kind("binary") set_kind("binary")
@ -29,7 +30,7 @@ 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 --test 3,4 for val=1,4 do
local strval = tostring(val) local strval = tostring(val)
add_tests(strval,{files="./day5/perfect/fix.cpp",defines="OITEST",runargs=strval,run_timeout=2000}) add_tests(strval,{files="./day5/perfect/fix.cpp",defines="OITEST",runargs=strval,run_timeout=2000})
end end