結果
問題 |
No.544 Delete 7
|
ユーザー |
![]() |
提出日時 | 2017-07-14 22:52:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 628 bytes |
コンパイル時間 | 673 ms |
コンパイル使用メモリ | 66,888 KB |
最終ジャッジ日時 | 2025-01-05 01:34:10 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 45 TLE * 3 |
ソースコード
#include <iostream> #include <stdio.h> #define rep(i,n) for(int i = 0;i < n;i++) #define REP(i,n,k) for(int i = n;i < k;i++) #define P(p) cout << (p) << endl;//print using namespace std; bool check(int a); int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; int m=0; cin >> n; int nn = n; while(check(n)||check(m)){ m+=n/2; n=nn-m; } cout << n << " " <<m << endl; return 0; } bool check(int a){ if(a<0) a = -a; for(int i=0;i<9;i++){ if(a%10==7){ return true; }else{ a=a/10; } } return false; }