結果
問題 | No.544 Delete 7 |
ユーザー |
|
提出日時 | 2017-07-14 23:22:56 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 654 bytes |
コンパイル時間 | 695 ms |
コンパイル使用メモリ | 63,652 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-07 23:33:24 |
合計ジャッジ時間 | 5,608 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 47 TLE * 1 |
ソースコード
#include <iostream> #include <stdio.h> #include <string> #include <vector> #include <cmath> #include <algorithm> #define MP make_pair using ll = long long; using namespace std; bool check(ll a) { ll tmp = a; for(;;){ if(tmp%10 == 7) return false; tmp /= 10; if(tmp == 0) return true; } } int main() { ll a,b,n; cin >> n; ll tmp = n; int k=0; int t=0; for(;;){ if((tmp/10) == 0){ t = tmp; break; } tmp /= 10; k++; } //a = (t+1) * pow(10, k); //b = n - a; ll i; for(i=1;; i++){ if(check(i) && check(n-i)) break; } cout << i << " " << n-i << endl; return 0; }