結果

問題 No.293 4>7の世界
ユーザー nico_shindanninnico_shindannin
提出日時 2015-10-23 22:40:30
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,618 bytes
コンパイル時間 1,755 ms
コンパイル使用メモリ 89,060 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-30 07:14:35
合計ジャッジ時間 1,530 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <bitset>
#include <stdio.h>
#include <string.h>
#include <assert.h>

using namespace std;
static const double EPS = 1e-9;
template<class T> bool INRANGE(T x,T a,T b){return a<=x&&x<=b;}
template<class T> void amin(T &a,T v){if(a>v) a=v;}
template<class T> void amax(T &a,T v){if(a<v) a=v;}
int ROUND(double x) { return (int)(x+0.5); }
bool ISINT(double x) { return fabs(ROUND(x)-x)<=EPS; }
bool ISEQUAL(double x,double y) { return fabs(x-y)<=EPS*max(1.0,max(fabs(x),fabs(y))); }
double SQSUM(double x,double y) { return x*x+y*y; }
#define PI  (acos(-1))
#define ARRAY_NUM(a) (sizeof(a)/sizeof(a[0])) 
#define NG (-1)
#define BIG ((int)1e9)
#define BIGLL ((ll)4e18)
#define SZ(a) ((int)(a).size())
#define SQ(a) ((a)*(a))
typedef long long ll;
typedef unsigned long long ull;


int main()
{
	string a,b;
	cin >> a >> b;

	string ans(a);
	if(SZ(a)>SZ(b))
	{
		ans = a;
	}
	else if (SZ(a)<SZ(b))
	{
		ans = b;
	}
	else
	{
		for (int i = 0; i < SZ(a); ++i)
		{
			if(a[i]==b[i]) continue;

			if(a[i]=='4' && b[i]=='7')
			{
				ans = a;
				break;
			}
			else if(a[i]=='7' && b[i]=='4')
			{
				ans = b;
				break;
			}
			else if (a[i]>b[i])
			{
				ans = a;
			}
			else
			{
				ans = b;
			}
		}
	}

	cout << ans << endl;


	return 0;

}
0