ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#213079 | #584. t3 | chendongyu | 0 | 0ms | 1192kb | C++11 | 672b | 2024-11-09 19:19:09 | 2024-11-09 23:06:54 |
answer
#include<bits/stdc++.h>
const int MOD=1000000007;
using namespace std;
int n,m;
int op,l,r,x;
int a[10500];
long long qpow(long long a,long long b)
{
long long res=1;
while(b)
{
if(b&1)
res=res*a%MOD;
b>>=1;
a=a*a%MOD;
}
return res;
}
int main()
{
scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++)
scanf("%d",a+i);
while(m--)
{
scanf("%d%d%d%d",&op,&l,&r,&x);
if(op==1)
for(int i=l;i<=r;i++)
a[i]=(a[i]+x)%MOD;
else if(op==2)
for(int i=l;i<=r;i++)
a[i]=x;
else
{
int ans=0;
for(int i=l;i<=r;i++)
{
ans+=qpow(a[i],x);
ans%=MOD;
}
printf("%d",ans);
}
}
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 1192kb
input:
458 823 14431 9895 11970 15308 2575 20181 709 27999 12992 18884 11061 16281 5044 28990 25092 28337 3...
output:
8060840961178843575815095079037545713813163257892036733123405236592423597417879888904010449907726698...
result:
wrong answer 1st lines differ - expected: '806084096', found: '806084096117884357581509507903...3716...
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 1192kb
input:
481 526 8409 14498 18636 10027 24362 32458 17986 17730 11956 19192 2193 1034 29317 19284 16210 26242...
output:
8671050977172659132883111903204523511334980374084732814132164880301825725976116306624711065524032560...
result:
wrong answer 1st lines differ - expected: '867105097', found: '867105097717265913288311190320...1468...
Test #3:
score: 0
Runtime Error
input:
100000 100000 15247 4194 9619 4532 22058 2667 21549 16652 25327 12018 13395 11426 7243 11714 22904 2...
output:
result:
Test #4:
score: 0
Runtime Error
input:
100000 100000 6264 26207 28424 24165 4852 20798 5803 18679 24588 12238 25786 28622 19900 101 25922 2...
output:
result:
Test #5:
score: 0
Runtime Error
input:
100000 100000 15043 9299 7163 25384 24996 3803 24356 12466 22073 12987 8931 14997 3951 32704 23076 8...
output:
result:
Test #6:
score: 0
Runtime Error
input:
100000 100000 14736 16956 19864 23894 29403 5507 12182 6188 17192 14440 18618 3970 15396 15037 23334...
output:
result:
Test #7:
score: 0
Runtime Error
input:
50000 50000 17799 29763 25337 21321 1391 31852 27418 28753 18524 14044 15976 18893 12274 22834 11348...
output:
result:
Test #8:
score: 0
Runtime Error
input:
50000 50000 10654 14956 14287 25326 8102 30579 11682 23553 272 22672 14460 30241 13026 12738 4912 72...
output:
result:
Test #9:
score: 0
Runtime Error
input:
90000 90000 29538 28214 24706 30393 27759 9002 13458 10243 15713 14881 10630 5593 7942 24578 29370 1...
output:
result:
Test #10:
score: 0
Runtime Error
input:
100000 100000 23515 49 31372 25112 16779 21279 30735 32743 14678 15189 1763 23114 32215 14873 20487 ...