結果

問題 No.1292 パタパタ三角形
ユーザー IlagIlag
提出日時 2020-11-20 21:50:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 771 bytes
コンパイル時間 1,657 ms
コンパイル使用メモリ 172,208 KB
実行使用メモリ 16,172 KB
最終ジャッジ日時 2023-09-30 19:08:45
合計ジャッジ時間 2,923 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 72 ms
16,020 KB
testcase_13 AC 71 ms
16,124 KB
testcase_14 AC 3 ms
4,376 KB
testcase_15 AC 3 ms
4,380 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1001001001;
const long long MOD = /**/1000000007;//*/998244353;
const double EPS = 1e-10;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    string s;
    cin>>s;
    map<pair<int,int>,int> mp;
    int t=-1,y=101010,x=101010;
    mp[make_pair(y,x)]++;
    for(int i=0;i<s.size();i++){
        if(s[i]=='a'){
            x+=t;
            mp[make_pair(y,x)]++;
            t*=-1;
        }
        if(s[i]=='b'){
            x+=-t;
            mp[make_pair(y,x)]++;
            t*=-1;
        }
        if(s[i]=='c'){
            y++;
            mp[make_pair(y,x)]++;
            t*=-1;
        }
    }
    int ans=0;
    for(auto v:mp)ans++;
    cout<<ans<<endl;
}
0