結果

問題 No.293 4>7の世界
ユーザー 唐澤貴洋唐澤貴洋
提出日時 2015-10-27 21:25:50
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 879 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 69,784 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-28 21:53:13
合計ジャッジ時間 1,654 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<list>
#include<stack>
#include<queue>
#include<bitset>
#include<array>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstdlib>
#include<numeric>
#define D			long long
#define U			unsigned
#define F(i,a)		for(i=0;i<a;i++)
#define bF(i,a)		for(i=1;i<=a;i++)
#define dF(i,a)		for(i=a-1;i>=0;i--)
#define bdF(i,a)	for(i=a;i>=1;i--)
#define LOCAL		D i=0,j=0,k=0,t=0,u=0
#define SIZE		1
using namespace std;
D n, m, a, b, d, e;
char c;
bool g, h;
string s;
D ans;
D p[SIZE];
int main() {
	LOCAL;
	cin >> a >> b;
	d = a;
	e = b;
	for (i = 1000000000; i > 0; i /= 10) {
		if ((a/i) % 10 == 4 && (b/i) % 10 == 7){
			a += i * 3;
			b -= i * 3;
		}
		else if ((a / i) % 10 == 7 && (b / i) % 10 == 4) {
			a -= i * 3;
			b += i * 3;
		}
	}
	if (a > b)
		cout << d << endl;
	else
		cout << e << endl;
}
0