QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#638255#5115. Clone Ranranwzxtsl#WA 82ms3716kbC++23612b2024-10-13 15:23:342024-10-13 15:23:34

Judging History

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

  • [2024-10-13 15:23:34]
  • 评测
  • 测评结果:WA
  • 用时:82ms
  • 内存:3716kb
  • [2024-10-13 15:23:34]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define For(i,aa,a) for(int i=aa;i<=a;i++)
int n,m;
const int N=2e6+7,INF=0x3f3f3f3f;
int a,b,c,ans;
int p[50];
void solve(){
    ans=INF;
    cin>>a>>b>>c;
    For(i,0,30)
    {
        if(p[i]>=c)
        {
            ans=min(ans,i*a+b);break;
        }
        else{
            int bb=(c+p[i]-1)/p[i];
            ans=min(ans,i*a+b*bb);
        }
    }
    cout<<ans<<endl;
}
signed main(){
    int t=1;
    p[0]=1;
    For(i,1,32)
        p[i]=2*p[i-1];
    cin>>t;
    while(t--){
        solve();
    }
}

详细

Test #1:

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

input:

5
1 1 1
2 3 3
9 9 9
3 26 47
1064 822 1048576

output:

1
7
45
44
21860

result:

ok 5 number(s): "1 7 45 44 21860"

Test #2:

score: -100
Wrong Answer
time: 82ms
memory: 3716kb

input:

99500
1000000000 1000000000 1000000000
1000000000 1000000000 999999999
1000000000 1000000000 999999998
1000000000 1000000000 999999997
1000000000 1000000000 999999996
1000000000 1000000000 999999995
1000000000 1000000000 999999994
1000000000 1000000000 999999993
1000000000 1000000000 999999992
10000...

output:

1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
1061109567
106...

result:

wrong answer 1st numbers differ - expected: '31000000000', found: '1061109567'