結果
問題 | No.544 Delete 7 |
ユーザー | mamekin |
提出日時 | 2017-07-14 22:25:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,065 bytes |
コンパイル時間 | 953 ms |
コンパイル使用メモリ | 104,000 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 16:01:39 |
合計ジャッジ時間 | 2,875 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 48 |
ソースコード
#define _USE_MATH_DEFINES #include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <limits> #include <climits> #include <cfloat> #include <functional> #include <iterator> using namespace std; unsigned xor128(){ static unsigned x=123456789,y=362436069,z=521288629,w=88675123; unsigned t; t=(x^(x<<11));x=y;y=z;z=w; return( w=(w^(w>>19))^(t^(t>>8)) ); } const int MAX = 1000000000; int main() { int n; cin >> n; for(;;){ int a = xor128() % (MAX * 2 + 1) - MAX; int b = n - a; if(-MAX <= b && b <= MAX){ string s = to_string(a); string t = to_string(b); if(s.find('7') == string::npos && t.find('7') == string::npos){ cout << a << ' ' << b << endl; return 0; } } } }