結果
問題 | No.2778 Is there Same letter? |
ユーザー |
|
提出日時 | 2024-08-15 14:58:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 354 bytes |
コンパイル時間 | 1,847 ms |
コンパイル使用メモリ | 193,912 KB |
最終ジャッジ日時 | 2025-02-23 22:45:13 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; string s; cin >> s; bool c = 0; for (int j = 0; j < n; j++) { for (int i = j + 1; i < n; i++) { if (s.substr(j, 1) == s.substr(i, 1))c = 1; } } if (c)cout << "Yes" << endl; else cout << "No" << endl; return 0; }