Skip to content

AtCoder/ABC077 #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions atcoder/abc077/A/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <bits/stdc++.h>

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);

string c1, c2;
cin >> c1 >> c2;
bool pass = (c1[0] == c2[2] && c2[0] == c1[2] && c1[1] == c2[1]);
cout << (pass ? "YES" : "NO") << endl;

return 0;
}
17 changes: 17 additions & 0 deletions atcoder/abc077/B/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <bits/stdc++.h>

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;
int M = round(floor(sqrt(N)));
cout << (M * M) << endl;

return 0;
}
33 changes: 33 additions & 0 deletions atcoder/abc077/C/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <bits/stdc++.h>

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;

vector<int> A(N), B(N), C(N);
for (auto &a : A) cin >> a;
for (auto &b : B) cin >> b;
for (auto &c : C) cin >> c;
sort(A.begin(), A.end());
sort(B.begin(), B.end());
sort(C.begin(), C.end());

ll ans = 0;
for (int i = 0; i < N; ++i) {
auto ita = lower_bound(A.begin(), A.end(), B[i]);
int sa = distance(A.begin(), ita);
auto itb = upper_bound(C.begin(), C.end(), B[i]);
int sb = distance(itb, C.end());
ans += ll(sa) * sb;
}
cout << ans << endl;

return 0;
}