結果
| 問題 |
No.2737 Compound Word
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-20 15:23:03 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 525 bytes |
| コンパイル時間 | 4,223 ms |
| コンパイル使用メモリ | 162,680 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-12 11:02:56 |
| 合計ジャッジ時間 | 5,206 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;cin >> n;
vector<string> s(n),t;
for(int i=0;i<n;i++){
cin >> s[i];
}
sort(s.begin(),s.end());
s.erase(unique(s.begin(), s.end()), s.end());
int l=s.size();
for(int i=0;i<l;i++){
for(int j=0;j<l;j++){
if(i!=j){
t.push_back(s[i]+s[j]);
}
}
}
sort(t.begin(),t.end());
t.erase(unique(t.begin(), t.end()), t.end());
l=t.size();
cout << l << "\n";
}