結果
| 問題 | No.544 Delete 7 | 
| コンテスト | |
| ユーザー |  hamray | 
| 提出日時 | 2019-03-21 17:13:27 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                CE
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 535 bytes | 
| コンパイル時間 | 409 ms | 
| コンパイル使用メモリ | 58,108 KB | 
| 最終ジャッジ日時 | 2024-11-14 21:20:42 | 
| 合計ジャッジ時間 | 960 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
            
            
            
            
            ただし、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);
      |                                                ^~~
            
            ソースコード
#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;
		} 
	}
	
}
            
            
            
        