結果
問題 | No.1292 パタパタ三角形 |
ユーザー |
![]() |
提出日時 | 2020-11-20 21:47:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 886 bytes |
コンパイル時間 | 1,688 ms |
コンパイル使用メモリ | 174,356 KB |
実行使用メモリ | 13,036 KB |
最終ジャッジ日時 | 2024-07-23 12:51:46 |
合計ジャッジ時間 | 5,464 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 14 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long int ll;typedef pair<ll,ll> P;typedef vector<ll> VI;typedef vector<VI> VVI;#define REP(i,n) for(int i=0;i<n;i++)#define ALL(v) v.begin(),v.end()constexpr ll MOD=1000000007;constexpr ll INF=1e18;int main(){string s; cin >> s;int n=s.size();set<pair<int,int>> st;st.insert({0,0});string p0[3]={"abc","bca","cab"};string p1[3]={"cab","abc","bca"};int x=0, y=0;REP(i,n){int p=((y+600000)/2+x*2+600000)%3;if(y%2==0){cout << p0[p] << endl;if(s[i]==p0[p][0])y++;else if(s[i]==p0[p][1])y--;elsey++,x--;}else{cout << p1[p] << endl;if(s[i]==p1[p][0])y++;else if(s[i]==p1[p][1])y--;elsey--,x++;}//cout << x << ' ' << y << endl;//cout << st.count({x,y}) << endl;st.insert({x,y});}cout << st.size() << endl;return 0;}