当前位置:网站首页>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;
}
边栏推荐
- Interpretation of concurrent virtual users, RPS and TPS
- 树状数组与ST表
- 【AntV G2】如何解决 G2 造成的内存泄露
- Unity notes 1
- Jmeter接口测试之响应断言
- "Visual C # from getting started to mastering" personal learning arrangement
- Buaaos-lab0 experimental report
- Attack and defense the world ---- shrink
- 第2章-系统控制原理 -> 经典控制理论
- 项目性能优化实战:解决首页白屏问题,自定义 loading 动画优化首屏效果
猜你喜欢

30分钟搞懂 HTTP 缓存

The solution to the bounce and offset of unity3d game characters when jumping to the ground

SSTI模板注入

Chapter 2 - system control principle - > classical control theory

Cocoon breaking and rebirth of 3D NFT: caduceus decentralized edge rendering technology

深入性能测试数据分析

SSTI模板注入

【HDRP高清渲染管道】创建HDRP工程,把内置管线工程升级为HDRP工程

攻防世界----shrine

并发虚拟用户、RPS、TPS的解读
随机推荐
西加加
Chapter 2 - system control principle - > classical control theory
【Unity编辑器扩展】Unity制作自己的专属的编辑器面板
Signal and system experiment
[antv G2] how to solve the memory leak caused by G2
攻防世界----shrine
[tools] unity screen drawing line, unity screen drawing Hsj drawing tool
bugku---game1
Attack and defense the world ---- shrink
VLAN和TRUNK口配置
[unity Editor Extension] unity publishes resources to the store process unity asset store publish
SSTI模板注入
JS note 1
Interpretation of concurrent virtual users, RPS and TPS
[tools] Application of SQLite local database in unity3d
元宇宙公链Caduceus详解:专为元宇宙应用打造的创作平台
After unity imports the FBX model, the rotation and position of the object will change automatically at runtime
Lecture 2 BTC cryptography principles (notes)
深入性能测试数据分析
Gdb+vscode debugging 6 -- Notes on GDB debugging multithreaded commands