結果

問題 No.116 門松列(1)
ユーザー kitsune
提出日時 2021-02-05 16:18:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 2,019 ms
コンパイル使用メモリ 197,956 KB
最終ジャッジ日時 2025-01-18 11:47:52
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
signed main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(auto &to : a)cin >> to;
    set<int> s;
    int ans = 0;
    for(int i=0;i<n;i++){
        set<int> s;
        for(int j=i;j<n;j++){
            if(s.count(a[j]))break;
            s.insert(a[j]);
            ans++;
        }
    }cout << ans << '\n';
    return 0;
}
0