我同样的代码提交四次就AC了!!!
#129426 #2520. 买木头 李凌宇 100 103ms 1600kb C++11 834b 2023-05-03 15:50:09打卡
#129425 #2520. 买木头 李凌宇 60 103ms 1600kb C++11 834b 2023-05-03 15:49:44打卡
#129424 #2520. 买木头 李凌宇 40 6ms 1604kb C++11 834b 2023-05-03 15:46:17打卡
#128754 #2520. 买木头 李凌宇 80 113ms 1596kb C++ 834b 2023-04-30 20:39:09打卡
在本地测试:
text1 10 10000 8 20
201
text2 10000 1000000 10000 100
2046
text3 8 50 12 45
9780
text4 9 8 7 6
9271
text5 4 6 2 9
4 6 2 9
我在少儿编程上不对的测试用例说我算出来的全是2:
80分时
input:
4 6 2 9
output:
2
result:
wrong answer 1st words differ - expected: '8570', found: '2'
40分时
input:
10 10000 8 20
output:
8
result:
wrong answer 1st words differ - expected: '201', found: '8'
input:
10000 1000000 10000 100
output:
2
result:
wrong answer 1st words differ - expected: '2046', found: '2'
input:
8 50 12 45
output:
12
result:
wrong answer 1st words differ - expected: '9780', found: '12'
60分时
input:
10 10000 8 20
output:
8
result:
wrong answer 1st words differ - expected: '201', found: '8'
input:
8 50 12 45
output:
12
result:
wrong answer 1st words differ - expected: '9780', found: '12'
而代码都是:
#include<iostream>
using namespace std;
int main() {
int n,m,l1,s1;
cin>>n>>m>>l1>>s1;
int l[n],r[n];
l[0]=l1;
r[0]=s1;
int min1=INT32_MAX,time1,time2;
for(int i=1;i<n;i++){
//l_i=((l_(i-1)×37011+10193) mod 10000)+1
//s_i=((s_(i-1)×73011+24793) mod 100)+1
l[i]=((l[i-1]*37011+10193)%10000)+1;
r[i]=((r[i-1]*73011+24793)%100)+1;
if(l[i]<min1){
min1=l[i];
}
}
if(l1<min1){
min1=l1;
}
for(int i=0;i<n;i++){
time1+=l[i]/min1*r[i];
time2+=l[i]/(min1+1)*r[i];
}
if(time1>=m&&time2<m){
cout<<min1;
return 0;
}
time1=0,time2=0;
int idx=1;
while(true){
for(int i=0;i<n;i++){
time1+=l[i]/(min1+idx)*r[i];
time2+=l[i]/(min1+idx+1)*r[i];
}
if(time1>=m&&time2<m){
cout<<min1+idx;
return 0;
}
idx++;
time1=0,time2=0;
}
return 0;
}
请问出什么问题了?
包括别人也出过这样的问题
例:Joker任务调度比赛时0分,比赛完之后在提交100分