/ Vijos / 讨论 / 过河 /

怎么会这样?求解!

测试数据 #0: Accepted, time = 0 ms, mem = 276 KiB, score = 10
测试数据 #1: WrongAnswer, time = 0 ms, mem = 276 KiB, score = 0
测试数据 #2: Accepted, time = 0 ms, mem = 280 KiB, score = 10
测试数据 #3: WrongAnswer, time = 0 ms, mem = 280 KiB, score = 0
测试数据 #4: WrongAnswer, time = 15 ms, mem = 276 KiB, score = 0
测试数据 #5: WrongAnswer, time = 0 ms, mem = 280 KiB, score = 0
测试数据 #6: WrongAnswer, time = 0 ms, mem = 276 KiB, score = 0
测试数据 #7: WrongAnswer, time = 15 ms, mem = 280 KiB, score = 0
测试数据 #8: WrongAnswer, time = 0 ms, mem = 276 KiB, score = 0
测试数据 #9: WrongAnswer, time = 0 ms, mem = 280 KiB, score = 0

#include<iostream>
using namespace std;

int main()
{
long length,jump;
int a, n, mini, maxi;
int rocks = 0;
int stop = 0;
int time = 0;
cin >> length >> mini >> maxi >> rocks;
long rockplaces[101];
for(a = 0 ; a < rocks ; a++)
{
cin >> rockplaces[a];
}
n = -1;
jump = mini;
while (n < rocks)
{
n++;
if (rockplaces[n] % jump == 0)
{
jump++;
if (jump > maxi)
{
jump = mini;
stop++;
}
}
}
cout << stop << endl;
return 0;

}

0 条评论

目前还没有评论...

信息

ID
1002
难度
7
分类
动态规划 点击显示
标签
递交数
25264
已通过
4390
通过率
17%
被复制
76
上传者