結果
| 問題 | No.3110 Like CPCTF? |
| コンテスト | |
| ユーザー |
テナガザル
|
| 提出日時 | 2025-04-19 01:39:42 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 0 ms / 2,000 ms |
| コード長 | 661 bytes |
| 記録 | |
| コンパイル時間 | 841 ms |
| コンパイル使用メモリ | 171,784 KB |
| 実行使用メモリ | 9,072 KB |
| 最終ジャッジ日時 | 2026-07-09 21:09:13 |
| 合計ジャッジ時間 | 2,075 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
string s;
cin >> s;
int ans = 0;
for (int i = 0; i < n; ++i)
{
for (int j = i + 2; j < n; ++j)
{
if (s[i] != s[j]) continue;
for (int a = i + 1; a < j; ++a)
{
if (s[a] == s[i]) continue;
for (int b = j + 1; b < n; ++b)
{
if (s[a] == s[b] || s[i] == s[b]) continue;
for (int c = b + 1; c < n; ++c)
{
if (s[a] == s[c] || s[b] == s[c] || s[i] == s[c]) continue;
++ans;
}
}
}
}
}
cout << ans << endl;
}
テナガザル