結果
| 問題 | No.544 Delete 7 |
| コンテスト | |
| ユーザー |
hamray
|
| 提出日時 | 2019-03-21 17:13:27 |
| 言語 | C++11(old_compat) (gcc 12.4.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 535 bytes |
| 記録 | |
| コンパイル時間 | 1,388 ms |
| コンパイル使用メモリ | 166,076 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-08 16:19:10 |
| 合計ジャッジ時間 | 2,992 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 48 |
ソースコード
#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;
}
}
}
hamray