当前位置:网站首页>This article only commemorates the modulus of negative numbers
This article only commemorates the modulus of negative numbers
2022-07-19 02:31:00 【HYYyyying】
Sum of equal ratio sequence ! Yes !!!
Please !!!wa???
The brain is a little dull , Think about !!!
Oh, Ho , There is a denominator under the proportional formula !!!
Inverse element ! Yes !!
Please !wa3???
Have a pleasant afternoon wa 了 8 Hair , So at night !!
Topic link !!!
18:39:09
After taking the module, the two numbers have no size relationship
18:39:16
Then subtract
18:39:19
There will be negative numbers
All starfish 18:45:04
Ah, this
All starfish 18:45:09
Let me think again
18:45:26
Don't you understand
All starfish 18:45:32
So
All starfish 18:45:40
Don't you cut your hair first
All starfish 18:45:42
Subtraction
18:45:57
For example 9-3=6 Yes 4 After taking the mold 1-3=-2
18:46:11
Your fast power is not modular ?
All starfish 18:46:22
Take the mold …
All starfish 18:46:28
therefore ..
18:46:47
So you see
All starfish 18:49:24 So fast exponents don't take modules …? ( I am a idiot. )
All starfish 18:49:29
That won't work
All starfish 18:49:42
/ Knock happy / Knock happy
18:49:43
Vomiting blood
18:50:03
If you have a negative number, you can take the module, and then add another module, and then take the module, and there will be no negative number
All starfish 18:50:27
Ah, this
18:50:44
Did I say something bad? You should sweat on me
All starfish 18:50:49
No
All starfish 18:50:52
I sweat myself
18:51:49
Now you understand
All starfish 18:52:02
I see !
All starfish 18:52:23
I see , then wa3
All starfish 18:52:31
( Hammer myself )
All starfish 18:55:29
I've been stuck this afternoon M
All starfish 18:55:35
I was still
All starfish 18:55:46
Got into inverse yuan
All starfish 18:55:49
EH …
All starfish 18:55:53
It's so sad
18:55:57
Of course, you have to go against the yuan
18:56:05
3 A series of equal proportions
All starfish 18:56:08
Yes
All starfish 18:56:12
want 2 Inverse element
18:56:13
To divide 2
All starfish 18:56:15
I did
All starfish 18:56:24
I didn't expect
All starfish 18:56:28
Stuck in a negative number
18:56:34
So there is the formula for summing the sequence of equal proportions , With subtraction
18:56:43
Stuck you all afternoon
All starfish 18:56:56
EH , Tired
All starfish 18:56:59
This lesson
All starfish 18:57:00
big
18:57:15
You must have a long memory
#include <cstdio>
#include <cstring>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <queue>
#include <set>
#include <cmath>
#include <map>
#include <bitset>
#include <vector>
#define pb push_back
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
#define pq priority_queue
#define eps 1e-10
#define PI acos(-1.0)
ll n;
ll a, b, c, d;
const ll mod = 1e9 + 7;
ll qpow(ll x, ll y){
ll res = 1;
while(y){
if(y & 1) res = res * x % mod; // Take the mold as needed
y >>= 1;
x = x * x % mod;
}
return res % mod;
}
int main(){
scanf("%lld", &n);
for(ll i = 1; i <= n; i++){
scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
ll q1 = qpow(2, b + 1);
ll q2 = qpow(2, a);
ll w1 = qpow(3, d + 1);
ll w2 = qpow(3, c);
ll r1 = q1 - q2;
if(r1 < 0){
r1 += mod;
}
r1 %= mod;
ll r2 = w1 - w2;
if(r2 < 0){
r2 += mod;
}
r2 %= mod;
ll t2 = qpow(2, mod - 2);
r2 = r2 * t2 % mod;
printf("%lld\n", r1 * r2 % mod);
}
return 0;
}
边栏推荐
- Attack and defense the world ---- shrink
- Experience in using flow playback tool Gor
- Attack and defense world - easytornado notes
- [tools] unity screen drawing line, unity screen drawing Hsj drawing tool
- If a hunter shoots a rabbit with a gun
- 攻防世界----shrine
- 项目性能优化实战:解决首页白屏问题,自定义 loading 动画优化首屏效果
- 登录功能的测试点大全
- 流量回放工具gor使用经验
- 第二讲 BTC-密码学原理(笔记)
猜你喜欢
随机推荐
Post man JSON script to JMX script of JMeter
MeterSphere基于JMeter分布式性能压测平台
Performance bottleneck positioning XMIND
JS笔记1
STL -- List container (linked list)
SSTI模板注入
Decentralized edge rendering meta universe protocol cadeus was invited to attend the cbaia 2022 summit to enable more Web3 application scenarios with technology
ctfhub--ssrf
Gdb+vscode debugging 6 -- Notes on GDB debugging multithreaded commands
SSTI模板注入
逻辑漏洞---登录验证码安全
STL -- stack container
Unity notes 1
【Unity开发小技巧】Unity混音器Mixer控制全局音量
Visual studio 2019-qt debugging
攻防世界----shrine
2022最新软件测试工具大全
元宇宙公链Caduceus详解:专为元宇宙应用打造的创作平台
GoReplay
php伪协议实现命令执行









