結果

問題 No.2737 Compound Word
コンテスト
ユーザー baohuy11
提出日時 2024-04-20 10:29:08
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 708 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 830 ms
コンパイル使用メモリ 90,488 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-04-28 17:41:41
合計ジャッジ時間 1,643 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
    int N;
    std::cin >> N;
    std::set<std::string> n_strings;
    for (int i = 0; i < N; ++i) {
        std::string s;
        std::cin >> s;
        for (int j = i + 1; j < N; ++j) {
            n_strings.insert(s + std::string(" ") + s);
            n_strings.insert(std::string(s.rbegin(), s.rend()) + std::string(" ") + s);
            n_strings.insert(s + std::string(" ") + std::string(s.rbegin(), s.rend()));
            n_strings.insert(std::string(s.rbegin(), s.rend()) + std::string(" ") + std::string(s.rbegin(), s.rend()));
        }
    }
    std::cout << n_strings.size() << std::endl;
    return 0;
}
0