6 条题解
-
0
#include using namespace std; int main() { int a, b, c, y1, y2, y3; cin >> a >> b >> c; if(a >= 3 || b >= 5 || c >= 7 || a < 0 || b < 0 || c < 0) { cout << "no answer" << endl; return 0; } y1 = 2; y2 = 1; y3 = 1; const int m1 = 3, m2 = 5, m3 = 7; const int M = m1 * m2 * m3; int M1 = M / m1; int M2 = M / m2; int M3 = M / m3; int x = (a * M1 * y1 + b * M2 * y2 + c * M3 * y3) % M; if(x <= 10) { x += M; } if(x > 1000000) { cout << "no answer"; } else { cout << x; } return 0; }
-
0
#include <iostream> #include <stack> #include <cmath> #include <vector> #include <string.h> #include <queue> #include <stdio.h> #include <iomanip> #include <cstdio> #include <algorithm> #define int long long using namespace std; const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; signed main() { int a, b, c; cin >> a >> b >> c; int num = 3; while(num % 3 != a || num % 5 != b || num % 7 != c) { num++; } cout << num << endl; return 0; }
- 1
信息
- ID
- 910
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 5
- 标签
- 递交数
- 840
- 已通过
- 304
- 上传者