信息
- ID
- 1134
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 6
- 标签
- (无)
- 递交数
- 34
- 已通过
- 12
- 上传者
遍历每一天,维护当前是星期几(若星期超过 7 则重置为 1);若当前是星期四且当天钱数 ≥100,输出该天的天数(第 i
天)。
#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve(){
int n, m;
cin >> n >> m;
int a[n + 1];
for(int i = 1; i <= n; i++){
cin >> a[i];
}
for(int i = 1; i <= n; i++){
if(m == 4){
if(a[i] >= 100){
cout << i << " ";
}
}
m++;
if(m == 8) m = 1;
}
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int T = 1;
// cin >> T;
while(T--){
solve();
}
return 0;
}