learn inverse
This commit is contained in:
parent
bd19c57854
commit
c2c24ea8b8
@ -79,6 +79,10 @@ ll ksm(ll a,ll b,ll M){
|
||||
## T9
|
||||
1. 先与后或先&后|
|
||||
|
||||
## Day7
|
||||
### 离线算法和在线算法
|
||||
>有预处理和没有预处理的区别
|
||||
|
||||
# 排序
|
||||
## 稳定性
|
||||
>隔着老远swap一般不稳定
|
||||
|
@ -13,7 +13,6 @@ int l2[MAX_N];
|
||||
#endif
|
||||
|
||||
int main(int argc,char* argv[]){
|
||||
|
||||
#ifdef OITEST
|
||||
// #define PRINT_VALUE(v){cout<<#v<<" :"<<(v)<<endl;}
|
||||
// PRINT_VALUE(argv[0])
|
||||
|
Binary file not shown.
BIN
day7/inverse/inverse_by_chat.pdf
Normal file
BIN
day7/inverse/inverse_by_chat.pdf
Normal file
Binary file not shown.
26
test.cpp
26
test.cpp
@ -1,6 +1,28 @@
|
||||
#include <bits/stdc++.h>
|
||||
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
|
||||
}
|
@ -14,7 +14,8 @@ target("st_done")
|
||||
|
||||
target("test")
|
||||
set_kind("binary")
|
||||
add_files("test.cpp")
|
||||
add_files("./test.cpp")
|
||||
add_tests("1",{files="./test.cpp",defines="OITEST",run_timeout=1000})
|
||||
|
||||
target("P3865")
|
||||
set_kind("binary")
|
||||
@ -29,7 +30,7 @@ target("fperfect")
|
||||
set_kind("binary")
|
||||
add_files("./day5/perfect/fix.cpp")
|
||||
set_rundir("./day5/perfect/")
|
||||
for val=1,4 do --test 3,4
|
||||
for val=1,4 do
|
||||
local strval = tostring(val)
|
||||
add_tests(strval,{files="./day5/perfect/fix.cpp",defines="OITEST",runargs=strval,run_timeout=2000})
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user