File tree Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Expand file tree Collapse file tree 3 files changed +67
-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
+ string c1, c2;
12
+ cin >> c1 >> c2;
13
+ bool pass = (c1[0 ] == c2[2 ] && c2[0 ] == c1[2 ] && c1[1 ] == c2[1 ]);
14
+ cout << (pass ? " YES" : " NO" ) << endl;
15
+
16
+ return 0 ;
17
+ }
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
+ int M = round (floor (sqrt (N)));
14
+ cout << (M * M) << endl;
15
+
16
+ return 0 ;
17
+ }
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
+
14
+ vector<int > A (N), B (N), C (N);
15
+ for (auto &a : A) cin >> a;
16
+ for (auto &b : B) cin >> b;
17
+ for (auto &c : C) cin >> c;
18
+ sort (A.begin (), A.end ());
19
+ sort (B.begin (), B.end ());
20
+ sort (C.begin (), C.end ());
21
+
22
+ ll ans = 0 ;
23
+ for (int i = 0 ; i < N; ++i) {
24
+ auto ita = lower_bound (A.begin (), A.end (), B[i]);
25
+ int sa = distance (A.begin (), ita);
26
+ auto itb = upper_bound (C.begin (), C.end (), B[i]);
27
+ int sb = distance (itb, C.end ());
28
+ ans += ll (sa) * sb;
29
+ }
30
+ cout << ans << endl;
31
+
32
+ return 0 ;
33
+ }
You can’t perform that action at this time.
0 commit comments