QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#204348#7562. Except Oneucup-team918#AC ✓0ms3736kbC++201.6kb2023-10-07 10:23:172023-10-07 10:23:17

Judging History

你现在查看的是最新测评结果

  • [2023-10-07 10:23:17]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3736kb
  • [2023-10-07 10:23:17]
  • 提交

answer

//#pragma GCC optimize(2)
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define N 200005
int mod;
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ld long double
#define ls (rt<<1)
#define rs ((rt<<1)|1)
#define SZ(x) (int)(x.size())
#define debug cout<<endl<<"ff"<<endl
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define fi first
#define se second
#define INF 1e9
#define pq priority_queue
#define rep(x,a,b) for(int x=a;x<=b;x++)
int qpow(int a,int b){
	int res=1;
	for(;b;b>>=1){
		if(b&1) res=res*a%mod;
		a=a*a%mod;
	}
	return res;
}
/*int fac[N],ifac[N];
int C(int n,int m){
	if(m>n||m<0||n<0) return 0;
	return fac[n]*ifac[n-m]%mod*ifac[m]%mod;
}
void init(){
	fac[0]=1;
	for(int i=1;i<N;i++) fac[i]=fac[i-1]*i%mod;
	ifac[N-1]=qpow(fac[N-1],mod-2);
	for(int i=N-2;i>=0;i--) ifac[i]=ifac[i+1]*(i+1)%mod;
}*/
/*struct node{
	int nxt,to;
}e[N<<1];
int cnt=1,head[N];
inline void add(int x,int y){
	e[++cnt].nxt=head[x];
	head[x]=cnt;
	e[cnt].to=y;
}*/
inline int lowbit(int x){return x&(-x);}
inline int read(){
  int x=0,t=1;char ch=getchar();
  while(ch<'0'||ch>'9'){
    if(ch=='-') t=-1;
    ch=getchar();
  }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch-'0');
        ch=getchar();
    }
    return x*t;
}
inline void write(int x){
	if(x<0) putchar('-'),x=-x;
	if(x>=10) write(x/10);
	putchar(x%10+'0');
}
int T,n,k,t;
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cin>>mod>>k>>t;
	cout<<qpow(mod-k,t)<<endl;
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3596kb

input:

7 5 3

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

11 6 7

output:

3

result:

ok 1 number(s): "3"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

3 2 1

output:

1

result:

ok 1 number(s): "1"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

596620183 516846890 38276329

output:

135352707

result:

ok 1 number(s): "135352707"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

382744931 85302262 235496559

output:

14577469

result:

ok 1 number(s): "14577469"

Test #6:

score: 0
Accepted
time: 0ms
memory: 3720kb

input:

659446013 641119314 378275666

output:

290624162

result:

ok 1 number(s): "290624162"

Test #7:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

227 163 124

output:

189

result:

ok 1 number(s): "189"

Test #8:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

197 187 19

output:

62

result:

ok 1 number(s): "62"

Test #9:

score: 0
Accepted
time: 0ms
memory: 3672kb

input:

5 3 3

output:

3

result:

ok 1 number(s): "3"

Test #10:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

7 6 4

output:

1

result:

ok 1 number(s): "1"

Test #11:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

7 1 1

output:

6

result:

ok 1 number(s): "6"

Test #12:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

782371 586755 418517

output:

298550

result:

ok 1 number(s): "298550"

Test #13:

score: 0
Accepted
time: 0ms
memory: 3724kb

input:

181081 178315 76002

output:

125177

result:

ok 1 number(s): "125177"

Test #14:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

715019 492103 446729

output:

221541

result:

ok 1 number(s): "221541"

Test #15:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

238985261 199832612 162675695

output:

65826267

result:

ok 1 number(s): "65826267"

Test #16:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

129716453 10994076 62963738

output:

5186275

result:

ok 1 number(s): "5186275"

Test #17:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

962360593 652577122 345596237

output:

814039152

result:

ok 1 number(s): "814039152"

Test #18:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

871606937 839183139 754188014

output:

466391387

result:

ok 1 number(s): "466391387"

Test #19:

score: 0
Accepted
time: 0ms
memory: 3724kb

input:

275568091 270750503 241146839

output:

252569968

result:

ok 1 number(s): "252569968"

Test #20:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

562028473 111749710 450258818

output:

63116256

result:

ok 1 number(s): "63116256"