11 条题解
-
-2
本题不用卡大常数,用vector判断长度即可 STL大法好()
#include <bits/stdc++.h> using namespace std; vector<int> ans; int main() { int a,b,c; cin >> a >> b >> c; int i = 1; while(ans.size()<10) { if(i%a == 1 && i%b == 1 && i%c == 1) ans.push_back(i); i+=1; } for(auto x:ans) cout << x << " "; return 0; }
- 1
信息
- ID
- 72
- 时间
- 10000ms
- 内存
- 128MiB
- 难度
- 5
- 标签
- 递交数
- 1519
- 已通过
- 532
- 上传者