diff --git a/atcoder/abc064/A/main.cpp b/atcoder/abc064/A/main.cpp new file mode 100644 index 00000000..26ff88ce --- /dev/null +++ b/atcoder/abc064/A/main.cpp @@ -0,0 +1,20 @@ +#include + +using namespace std; +using ll = long long; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + int r, g, b; + cin >> r >> g >> b; + int rgb = r * 100 + g * 10 + b; + if (rgb % 4 == 0) { + cout << "YES" << endl; + } else { + cout << "NO" << endl; + } + + return 0; +} \ No newline at end of file diff --git a/atcoder/abc064/B/main.cpp b/atcoder/abc064/B/main.cpp new file mode 100644 index 00000000..435a8821 --- /dev/null +++ b/atcoder/abc064/B/main.cpp @@ -0,0 +1,27 @@ +#include + +using namespace std; +using ll = long long; + +int N; +vector A; + +int solve() { + int mini = *min_element(A.begin(), A.end()); + int maxi = *max_element(A.begin(), A.end()); + return maxi - mini; +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + cin >> N; + A.assign(N, 0); + for (int i = 0; i < N; ++i) { + cin >> A[i]; + } + cout << solve() << endl; + + return 0; +} \ No newline at end of file diff --git a/atcoder/abc064/C/main.cpp b/atcoder/abc064/C/main.cpp new file mode 100644 index 00000000..f783ef30 --- /dev/null +++ b/atcoder/abc064/C/main.cpp @@ -0,0 +1,40 @@ +#include + +using namespace std; +using ll = long long; + +int N; +vector A; + +vector solve() { + int K = 0; + unordered_set S; + for (auto a : A) { + if (a < 400) S.insert(0); + else if (a < 800) S.insert(1); + else if (a < 1200) S.insert(2); + else if (a < 1600) S.insert(3); + else if (a < 2000) S.insert(4); + else if (a < 2400) S.insert(5); + else if (a < 2800) S.insert(6); + else if (a < 3200) S.insert(7); + else ++K; + } + if (S.empty()) return { 1, K }; + return { (int)S.size(), (int)S.size() + K }; +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + cin >> N; + A.assign(N, 0); + for (int i = 0; i < N; ++i) { + cin >> A[i]; + } + auto minmax = solve(); + cout << minmax[0] << " " << minmax[1] << endl; + + return 0; +} \ No newline at end of file diff --git a/atcoder/abc064/D/main.cpp b/atcoder/abc064/D/main.cpp new file mode 100644 index 00000000..048f7c6e --- /dev/null +++ b/atcoder/abc064/D/main.cpp @@ -0,0 +1,37 @@ +#include + +using namespace std; +using ll = long long; + +int N; +string S; + +string solve() { + deque Q; + int k = 0; + for (auto c : S) { + if (c == '(') { + Q.push_back(c); + k++; + } else if (c == ')') { + Q.push_back(c); + if (k > 0) --k; + else Q.push_front('('); + } + } + while (k > 0) { + Q.push_back(')'); + --k; + } + return string(Q.begin(), Q.end()); +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + cin >> N >> S; + cout << solve() << endl; + + return 0; +} \ No newline at end of file