結果
| 問題 |
No.544 Delete 7
|
| コンテスト | |
| ユーザー |
Ronlynes
|
| 提出日時 | 2017-07-15 14:28:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 550 bytes |
| コンパイル時間 | 629 ms |
| コンパイル使用メモリ | 56,396 KB |
| 実行使用メモリ | 13,636 KB |
| 最終ジャッジ日時 | 2024-10-08 02:22:27 |
| 合計ジャッジ時間 | 3,219 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 2 TLE * 1 -- * 45 |
ソースコード
#include <iostream>
#include <string>
#define MAX 1000000000
using namespace std;
bool check(long long x){
string s = to_string(x);
for(int i=0; i<s.length(); i++){
if(s[i] == '7'){
return false;
}
}
return true;
}
int main(void){
long long n;
cin >> n;
for(int i=1;i<=MAX;i++){
long long a = i;
long long b = n - i;
if( check(a) && check(b) ){
cout << a << " " << b << endl;
return 0;
}
}
cout << "-1" << endl;
return 0;
}
Ronlynes