結果
| 問題 | No.3714 Prefix Team Name |
| コンテスト | |
| ユーザー |
ぽえ
|
| 提出日時 | 2026-09-15 08:12:12 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 293 ms / 2,000 ms |
| + 159µs | |
| コード長 | 520 bytes |
| 記録 | |
| コンパイル時間 | 2,421 ms |
| コンパイル使用メモリ | 348,224 KB |
| 実行使用メモリ | 151,296 KB |
| 最終ジャッジ日時 | 2026-09-18 20:50:58 |
| 合計ジャッジ時間 | 7,457 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main() {
vector<string> s(3); for (auto& i : s) cin >> i;
vector<vector<string>> pref(3);
for (int i=0; i<3; i++) for (int j=1; j<=(int)s[i].size(); j++) pref[i].push_back(s[i].substr(0, j));
set<string> st;
vector<int> perm(3); iota(perm.begin(), perm.end(), 0);
do { for (auto& i : pref[perm[0]]) for (auto& j : pref[perm[1]]) for (auto& k : pref[perm[2]]) st.insert(i+j+k); } while (next_permutation(perm.begin(), perm.end()));
cout << st.size() << '\n';
}
ぽえ