結果

問題 No.544 Delete 7
ユーザー hamrayhamray
提出日時 2019-03-21 17:13:27
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 535 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 59,172 KB
最終ジャッジ日時 2024-04-27 02:50:27
合計ジャッジ時間 1,158 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:48: error: ‘pow’ was not declared in this scope
   14 |                         if (bit >> i & 1) t += pow(10, i);
      |                                                ^~~

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;

#define MAXV 1000000000
using ll = long long;
int main() {
	ll N; cin >> N;

	for (ll bit = 0; bit < (1 << 9); ++bit) {
		ll t = 0;
		for (int i = 0; i < 10; ++i) {
			if (bit >> i & 1) t += pow(10, i);
		}

		ll a = t, b = abs(N - a);

		bool c = true;
		while (a) {
			if (a % 10 == 7) c = false;
			a /= 10;
		}

		while (b) {
			if (b % 10 == 7) c = false;
			b /= 10;
		}

		if (c) {
			cout << t << " " << N - t << endl;
			return 0;
		} 

	}

	
}
0