当前位置:网站首页>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;
}
边栏推荐
- 2022最新软件测试工具大全
- 【已解决】参考了本地mysql忘记密码后, [Server] --initialize specified but the data directory has files in it. Aborti
- 面试:接口和抽象类的区别-简洁的总结
- Interpretation of concurrent virtual users, RPS and TPS
- Project Performance Optimization Practice: solve the white screen problem of the home page, customize the loading animation to optimize the first screen effect
- 【Unity编辑器扩展】Unity发布资源到商店流程Unity Asset Store Publish
- Signal and system experiment
- How to do a good job of test case review
- UE4 笔记
- STL -- set container
猜你喜欢
随机推荐
UE4 notes
Performance traffic playback
[antv G2] how to solve the memory leak caused by G2
【HDRP高清渲染管道】创建HDRP工程,把内置管线工程升级为HDRP工程
Chapter 2 - system control principle - > classical control theory
[tools] unity quickly starts to make the artifact tilemap of 2D and 2.5D games
Jstat命令查看jvm的GC情况
Attack and defense the world ---- shrink
Analysis of the paradise of metauniverse developers the ecological value of the metauniverse protocol caduceus
性能测试实施规范指南
使用JMeter测试基于WebSocket协议的服务
30分钟搞懂 HTTP 缓存
逻辑漏洞---登录验证码安全
Signal and system experiment
网络一般知识(详)
Nmon使用方法
2022.6.28-数据库-1.数据库的隔离级别
逆元(名字太多人用我就加这几个字)
Unity3D 游戏人物跳跃落地时发生弹跳,偏移情况的解决方法
SSTI template injection









