File tree 4 files changed +96
-0
lines changed
4 files changed +96
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include < bits/stdc++.h>
2
+
3
+ using namespace std ;
4
+ using ll = int64_t ;
5
+ using ff = long double ;
6
+
7
+ int main () {
8
+ ios_base::sync_with_stdio (false );
9
+ cin.tie (0 ); cout.tie (0 );
10
+
11
+ int A, B;
12
+ cin >> A >> B;
13
+
14
+ if (A >= 10 || B >= 10 ) {
15
+ cout << -1 << endl;
16
+ } else {
17
+ cout << (A * B) << endl;
18
+ }
19
+
20
+ return 0 ;
21
+ }
Original file line number Diff line number Diff line change
1
+ #include < bits/stdc++.h>
2
+
3
+ using namespace std ;
4
+ using ll = int64_t ;
5
+ using ff = long double ;
6
+
7
+ int main () {
8
+ ios_base::sync_with_stdio (false );
9
+ cin.tie (0 ); cout.tie (0 );
10
+
11
+ int N;
12
+ cin >> N;
13
+ bool found = false ;
14
+ for (int x = 1 ; x <= 9 ; ++x) {
15
+ for (int y = 1 ; y <= 9 ; ++y) {
16
+ if (x * y == N) {
17
+ found = true ;
18
+ break ;
19
+ }
20
+ }
21
+ }
22
+ cout << (found ? " Yes" : " No" ) << endl;
23
+
24
+ return 0 ;
25
+ }
Original file line number Diff line number Diff line change
1
+ #include < bits/stdc++.h>
2
+
3
+ using namespace std ;
4
+ using ll = int64_t ;
5
+ using ff = long double ;
6
+
7
+ ll solve (ll N) {
8
+ ll ans = N;
9
+ for (ll x = 1 ; x * x <= N; ++x) {
10
+ if (N % x == 0 ) {
11
+ ll y = N / x;
12
+ ans = min (ans, (x-1 )+(y-1 ));
13
+ }
14
+ }
15
+ return ans;
16
+ }
17
+
18
+ int main () {
19
+ ios_base::sync_with_stdio (false );
20
+ cin.tie (0 ); cout.tie (0 );
21
+
22
+ ll N;
23
+ cin >> N;
24
+ cout << solve (N) << endl;
25
+
26
+ return 0 ;
27
+ }
Original file line number Diff line number Diff line change
1
+ #include < bits/stdc++.h>
2
+
3
+ using namespace std ;
4
+ using ll = int64_t ;
5
+ using ff = long double ;
6
+
7
+ int main () {
8
+ ios_base::sync_with_stdio (false );
9
+ cin.tie (0 ); cout.tie (0 );
10
+
11
+ int a, b, x;
12
+ cin >> a >> b >> x;
13
+ ff theta;
14
+ if (2 * x >= a * a * b) {
15
+ theta = atan2 (2 * a * a * b - 2 * x, a * a * a);
16
+ } else {
17
+ theta = M_PI / ff (2.0 ) - atan2 (2 * x, a * b * b);
18
+ }
19
+ theta = theta * ff (180 ) / M_PI;
20
+ cout << fixed << setprecision (7 ) << theta << endl;
21
+
22
+ return 0 ;
23
+ }
You can’t perform that action at this time.
0 commit comments