'commit'
This commit is contained in:
14
TangDou/Mkx/MakeXing/2023C2_1/1.cpp
Normal file
14
TangDou/Mkx/MakeXing/2023C2_1/1.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
int main() {
|
||||
int s;
|
||||
cin >> s;
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
int x;
|
||||
cin >> x;
|
||||
s -= x;
|
||||
}
|
||||
cout << s << endl;
|
||||
return 0;
|
||||
}
|
||||
15
TangDou/Mkx/MakeXing/2023C2_1/2.cpp
Normal file
15
TangDou/Mkx/MakeXing/2023C2_1/2.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
int s, c, r;
|
||||
int main() {
|
||||
cin >> s >> c >> r;
|
||||
for (int b = r + 1;; b++) {
|
||||
int a = s - b - c - r;
|
||||
if (a / b == c && a % b == r && a + b + c + r == s) {
|
||||
printf("%d %d", a, b);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user