2021-06-28から1日間の記事一覧

AtCoder Grand Contest 054 A - Remove Substrings

公式の回答を自分で理解するために実装。条件分岐? #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; string s; cin >> s; int ret = -1; if (s.front() != s.back()) { ret = 1; cout </bits/stdc++.h>…