P1424 小鱼的航程(改进版)

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
LL a, b, c = 0, d = 0;
cin >> a >> b;
c = b / 7 * 250 * 4;
d = b % 7;
for (LL i = 1; i <= d; i++) {
if ((a % 7 + i) % 7 != 6 || (a % 7 + i) % 7 != 0) {
c += 250;
}
}
cout << c << endl;
return 0;
}
1179

被折叠的 条评论
为什么被折叠?



