結果
| 問題 |
No.1292 パタパタ三角形
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2023-03-29 14:46:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 466 bytes |
| コンパイル時間 | 863 ms |
| コンパイル使用メモリ | 75,396 KB |
| 最終ジャッジ日時 | 2025-02-11 18:59:50 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 9 |
ソースコード
#include <iostream>
#include <set>
using namespace std;
int main(){
string s;cin>>s;
pair<int,int> nw = {0,0};
set<pair<int,int>> A;
A.insert(nw);
for(int i = 0; s.size() > i; i++){
if(i%2){
if(s[i] == 'a')nw.second--;
else if(s[i] == 'b')nw.first++;
else nw.second++;
}else{
if(s[i] == 'a')nw.second++;
else if(s[i] == 'b')nw.first--;
else nw.second--;
}
A.insert(nw);
}
cout << A.size() << endl;
}