結果
| 問題 | No.3210 Fixed Sign Sequense |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-05-04 05:52:05 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 640 bytes |
| 記録 | |
| コンパイル時間 | 935 ms |
| コンパイル使用メモリ | 180,780 KB |
| 実行使用メモリ | 10,704 KB |
| 最終ジャッジ日時 | 2026-05-04 05:52:35 |
| 合計ジャッジ時間 | 4,743 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | TLE * 1 -- * 37 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
int n;
cin >> n;
string s;
cin.ignore();
getline(cin, s);
set<int> c;
for(int i = 0; i < n-1; i++){
int count = 1;
char x = s[i];
for(int j = i+1; j < n; j++){
if(x == '-' && (s[j] == '0' || s[j] == '+')){
count++;
x = s[j];
}
else if((x == '0' || x == '+') && s[j] == '+'){
count++;
x = s[j];
}
}
c.insert(count);
}
cout << *c.rbegin() << endl;
return 0;
}
vjudge1