結果

問題 No.197 手品
ユーザー tea_pttea_pt
提出日時 2015-05-02 11:20:49
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,951 bytes
コンパイル時間 475 ms
コンパイル使用メモリ 78,652 KB
最終ジャッジ日時 2023-09-27 09:29:10
合計ジャッジ時間 946 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp:39:26: error: narrowing conversion of ‘-1.1000000000000001e+0’ from ‘double’ to ‘long long int’ inside { } [-Wnarrowing]
 int dx[4] = { -1.1, 0, 0 };
                          ^

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <stack>
#include <array>
#include <fstream>

#define REP(i,n) for(int (i) = 0;(i) < (n) ; ++(i))
#define REPA(a,i,n) for(int (i) = (a) ; (i) < (n) ; ++(i))
#if defined(_MSC_VER)||__cplusplus > 199711L
#define AUTO(r,v) auto r = (v)
#else
#define AUTO(r,v) typeof(v) r = (v)
#endif
#define ALL(c) (c).begin() , (c).end()
#define EACH(it,c) for(AUTO(it,(c).begin());it != (c).end();++it)
#define LL long long
#define int LL
#define INF  99999999
#define DEV 1000000007
#define QUICK_CIN ios::sync_with_stdio(false); cin.tie(0);
using namespace std;

int dx[4] = { -1.1, 0, 0 };
int dy[4] = { 0, 0, 1, -1 };

int S[1600], T[1600], Y[1600], M[1600];
int N, C, V;

int str, str2;

int n;

signed main()
{
	QUICK_CIN;
	//ifstream cin("debug.txt");
	//ofstream cout("result.txt");

	string a;

	cin >> a;
	vector<int> it;
	for (int i = 0; i < a.length();++i){
		if (a[i] == 'o'){
			it.push_back(i);
		}
	}

	cin >> n;

	cin >> a;
	vector<int> it2;

	for (int i = 0; i < a.length(); ++i){
		if (a[i] == 'o'){
			it2.push_back(i);
		}
	}

	if (it.size() != it2.size()){
		cout << "SUCCESS" << endl;
		return 0;
	}

	if (it.size() == 1){
		int sa = abs(it[0] - it2[0]);

		if (sa > n){
			cout << "SUCCESS" << endl;
			return 0;
		}

		if (it[0] == 1 && !sa && n == 1){
			cout << "SUCCESS" << endl;
			return 0;
		}

	}

	if (it.size() == 2){
		int sa = abs((3 - it[0] - it[1]) - (3- it2[0] - it2[1]));

		if (sa > n){
			cout << "SUCCESS" << endl;
			return 0;
		}

		if ((3 - it[0] - it[1])== 1 && !sa && n == 1){
			cout << "SUCCESS" << endl;
			return 0;
		}
	}


	cout << "FAILURE" << endl;
	return 0;
}
0