結果
| 問題 | No.2737 Compound Word |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2024-04-30 18:50:54 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 681 bytes |
| 記録 | |
| コンパイル時間 | 643 ms |
| コンパイル使用メモリ | 85,992 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-04 15:57:45 |
| 合計ジャッジ時間 | 1,761 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 2737.cc: No.2737 Compound Word - yukicoder
*/
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 50;
const int MAX_L = 100;
/* typedef */
/* global variables */
string ss[MAX_N], ts[MAX_N * MAX_N];
/* subroutines */
/* main */
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
char s[MAX_L + 4];
scanf("%s", s);
ss[i] = string(s);
}
int m = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
if (i != j) ts[m++] = ss[i] + ss[j];
sort(ts, ts + m);
m = unique(ts, ts + m) - ts;
printf("%d\n", m);
return 0;
}
tnakao0123