diff --git a/atcoder/abc144/A/main.cpp b/atcoder/abc144/A/main.cpp new file mode 100644 index 00000000..dbf2f9e7 --- /dev/null +++ b/atcoder/abc144/A/main.cpp @@ -0,0 +1,21 @@ +#include + +using namespace std; +using ll = int64_t; +using ff = long double; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + int A, B; + cin >> A >> B; + + if (A >= 10 || B >= 10) { + cout << -1 << endl; + } else { + cout << (A * B) << endl; + } + + return 0; +} \ No newline at end of file diff --git a/atcoder/abc144/B/main.cpp b/atcoder/abc144/B/main.cpp new file mode 100644 index 00000000..77f666e1 --- /dev/null +++ b/atcoder/abc144/B/main.cpp @@ -0,0 +1,25 @@ +#include + +using namespace std; +using ll = int64_t; +using ff = long double; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + int N; + cin >> N; + bool found = false; + for (int x = 1; x <= 9; ++x) { + for (int y = 1; y <= 9; ++y) { + if (x * y == N) { + found = true; + break; + } + } + } + cout << (found ? "Yes" : "No") << endl; + + return 0; +} \ No newline at end of file diff --git a/atcoder/abc144/C/main.cpp b/atcoder/abc144/C/main.cpp new file mode 100644 index 00000000..1eb85533 --- /dev/null +++ b/atcoder/abc144/C/main.cpp @@ -0,0 +1,27 @@ +#include + +using namespace std; +using ll = int64_t; +using ff = long double; + +ll solve(ll N) { + ll ans = N; + for (ll x = 1; x * x <= N; ++x) { + if (N % x == 0) { + ll y = N / x; + ans = min(ans, (x-1)+(y-1)); + } + } + return ans; +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + ll N; + cin >> N; + cout << solve(N) << endl; + + return 0; +} \ No newline at end of file diff --git a/atcoder/abc144/D/main.cpp b/atcoder/abc144/D/main.cpp new file mode 100644 index 00000000..14829981 --- /dev/null +++ b/atcoder/abc144/D/main.cpp @@ -0,0 +1,23 @@ +#include + +using namespace std; +using ll = int64_t; +using ff = long double; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + int a, b, x; + cin >> a >> b >> x; + ff theta; + if (2 * x >= a * a * b) { + theta = atan2(2 * a * a * b - 2 * x, a * a * a); + } else { + theta = M_PI / ff(2.0) - atan2(2 * x, a * b * b); + } + theta = theta * ff(180) / M_PI; + cout << fixed << setprecision(7) << theta << endl; + + return 0; +} \ No newline at end of file