結果
問題 | No.2737 Compound Word |
ユーザー |
|
提出日時 | 2024-04-23 14:01:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 434 bytes |
コンパイル時間 | 1,501 ms |
コンパイル使用メモリ | 174,100 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 14:06:52 |
合計ジャッジ時間 | 2,464 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define ll long long#define pll pair<ll,ll>#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)int main(){ll n;cin >> n;vector<string> s(n);rep(i,n){cin >> s[i];}set<string> t;rep(i,n-1){for(ll j = i + 1; j < n; j++){t.insert(s[i]+s[j]);t.insert(s[j] + s[i]);}}cout << t.size() << endl;}