クイックルックパワー

1。

 https://cn.vjudge.net/contest/317382#problem/E

かわいいA ^ B

 

#include <ビット/ STDC ++ H> 
名前空間STDを使用して、
typedefの長い長いLL。
LL、B; 
LLのQMOD(-1,11,11-のB、LLのM)
{ 
	LL ANS = 1。
	(b)は、一方
	{ 
		IF(B&1)ANS = ANS *%のM。
		= A *%のM。
		B >> = 1。
	} 
	戻りANS。
} 
int型のmain()
{ 
	一方(CIN >> A >> B &&(|| B))
		COUT << QMOD(A、B、1000)<< "の\ n"。
	0を返します。
}

2。

右端の桁

 https://cn.vjudge.net/contest/317382#problem/D

#include <ビット/ STDC ++ H> 
名前空間STDを使用して、
typedefの長い長いLL。
LLのトン、; 
LLのQMOD(-1,11,11-のB、LLのM)
{ 
	LL ANS = 1。
	(b)は、一方
	{ 
		IF(B&1)ANS = ANS *%のM。
		= A *%のM。
		B >> = 1。
	} 
	戻りANS。
} 
int型のmain()
{ 
	CIN >> T。
	一方、(t--)
	{ 
		CIN >>。
		COUT << QMOD(10)<< ENDL。
	} 
	0を返します。
}

3。

https://cn.vjudge.net/contest/317382#problem/A4。

#include <ビット/ STDC ++ H> 
名前空間STDを使用して、
typedefの長い長いLL。
LL、B、M。
LLのQMOD(-1,11,11-のB、LLのM)
{ 
	LL ANS = 1。
	(b)は、一方
	{ 
		IF(B&1)ANS = ANS *%のM。
		= A *%のM。
		B >> = 1。
	} 
	戻りANS。
} 
int型のmain()
{ 
	int型のT。
	cinを>>トン。
	一方、(t--)
	{ 
		CIN >> A >> B >> M。
		COUT << QMOD(A、B、M)<< ENDL。
	} 
	0を返します。
}

  

4。

モジュロ番号を上げます

 https://cn.vjudge.net/contest/317382#problem/B

書式#include <iostreamの> 
の#include <cstdioを> 
std名前空間を使用しました。
typedefの長い長いLL。
LL T、M、H、B、RES。
LLのQMOD(-1,11,11-のB、LLのM)
{ 
	LL ANS = 1。
	(b)は、一方
	{ 
		IF(B&1)ANS = ANS *%のM。
		= A *%のM。
		B >> = 1。
	} 
	戻りANS。
} 
int型のmain()
{ 
	scanf関数( "%のLLD"、&T)。
	(T--)一方
	{ 
		RES = 0。
		scanf関数( "%のLLDの%のLLD"、&M、&H)。
		(H--)一方
		{ 
			scanf関数( "%のLLDの%のLLD"、&、&B)。
			RES =(RES + QMOD(A、B、M))%のM。
		} 
		のprintf( "%LLDする\ n"、RES)。
	} 
	0を返します。

  

5。

これは難しい問題です。ZOJ1333

https://cn.vjudge.net/contest/317382#problem/C

おすすめ

転載: www.cnblogs.com/dragondragon/p/11321995.html
おすすめ