結果
| 問題 | No.3714 Prefix Team Name |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-19 02:03:16 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 330 ms / 2,000 ms |
| + 943µs | |
| コード長 | 571 bytes |
| 記録 | |
| コンパイル時間 | 1,592 ms |
| コンパイル使用メモリ | 190,976 KB |
| 実行使用メモリ | 130,688 KB |
| 最終ジャッジ日時 | 2026-09-19 02:03:27 |
| 合計ジャッジ時間 | 7,488 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
using ll = long long;
int main(void){
string x[3]; cin >> x[0] >> x[1] >> x[2];
set<string> all;
int p[3]={0, 1, 2};
int l[3]={(int)x[0].size(), (int)x[1].size(), (int)x[2].size()};
do{
for(int i=1; i<=l[p[0]]; i++)for(int j=1; j<=l[p[1]]; j++)for(int k=1; k<=l[p[2]]; k++){
string now=x[p[0]].substr(0, i)+x[p[1]].substr(0, j)+x[p[2]].substr(0, k);
all.insert(now);
}
}while(next_permutation(p, p+3));
cout << all.size() << endl;
return 0;
}