結果
| 問題 |
No.544 Delete 7
|
| コンテスト | |
| ユーザー |
aaa
|
| 提出日時 | 2018-09-23 20:39:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 901 bytes |
| コンパイル時間 | 1,114 ms |
| コンパイル使用メモリ | 97,448 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 14:46:10 |
| 合計ジャッジ時間 | 3,252 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 48 |
ソースコード
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
using namespace std;
int main() {
int i, j, k;
long n;
string s, s1, s2;
bool flag = false;
cin >> n;
for (long i = 1; i < n; i++) {
bool flag = false;
s1 = to_string(n - i);
s2 = to_string(i);
if (s1.find("7") == string::npos && s2.find("7") == string::npos) {
flag = true;
break;
}
for (j = 0; j < s1.length(); j++) {
if (s1[j] == '7') {
string ss = "1";
for (k = 0; k < s1.length() - j - 1; k++) {
ss += "0";
}
long nn = stol(ss);
i += nn;
}
}
}
cout << s1 << " " << s2 << endl;
getchar();
getchar();
return 0;
}
aaa