結果
| 問題 |
No.1292 パタパタ三角形
|
| コンテスト | |
| ユーザー |
Ilag
|
| 提出日時 | 2020-11-20 22:03:33 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 575 bytes |
| コンパイル時間 | 1,623 ms |
| コンパイル使用メモリ | 174,772 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-23 13:02:02 |
| 合計ジャッジ時間 | 2,355 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 9 |
ソースコード
#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<ll,ll>,ll> mp;
ll t=1,y=202020,x=202020;
mp[make_pair(y,x)]++;
for(ll i=0;i<s.size();i++){
if(s[i]=='a')x+=t;
else if(s[i]=='b')x-=t;
else y-=t;
mp[make_pair(y,x)]++;
t*=-1;
}
ll ans=0;
for(auto v:mp)ans++;
cout<<ans<<endl;
}
Ilag