結果
| 問題 | No.1292 パタパタ三角形 | 
| コンテスト | |
| ユーザー |  madoka | 
| 提出日時 | 2020-11-22 15:08:57 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 697 bytes | 
| コンパイル時間 | 512 ms | 
| コンパイル使用メモリ | 67,432 KB | 
| 実行使用メモリ | 12,928 KB | 
| 最終ジャッジ日時 | 2024-07-23 16:31:34 | 
| 合計ジャッジ時間 | 1,469 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 3 WA * 11 | 
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    7 | main()
      | ^~~~
            
            ソースコード
#include<iostream>
#include<set>
#include<algorithm>
using namespace std;
string s;
set<pair<int,int> >S;
main()
{
	cin>>s;
	int x=0,y=0;
	string n="abc";
	S.insert(make_pair(x,y));
	long long cnt;
	cnt=0;
	for(char t:s)
	{
		if(cnt%2==0)
		{
			if(n[0]==t)
			{
				y++;
				
				//swap(n[1],n[2]);
			}
			else if(n[1]==t)
			{
				x++;
				y--;
				swap(n[0],n[2]);
			}
			else
			{
				x--;
				y--;
				swap(n[0],n[1]);
			}
		}
		else
		{
			if(n[0]==t)
			{
				y--;
				//swap(n[1],n[2]);
			}
			else if(n[1]==t)
			{
				x++;
				y++;
				swap(n[0],n[2]);
			}
			else
			{
				x--;
				y++;
				swap(n[0],n[1]);
			}
		}
		cnt++;
		S.insert(make_pair(x,y));
	}
	cout<<S.size()<<endl;
}
            
            
            
        