結果
問題 |
No.544 Delete 7
|
ユーザー |
![]() |
提出日時 | 2023-09-04 15:59:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 910 bytes |
コンパイル時間 | 4,135 ms |
コンパイル使用メモリ | 251,532 KB |
最終ジャッジ日時 | 2025-02-16 18:36:05 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 48 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using namespace std; using ll=int; using ld=long double; ld pie=3.141592653589793; ll mod=998244353; ll inf=1009; int main(){ srand((unsigned)time(NULL)); ll n; cin >> n; for (ll i = 0; i >=0; i++) { ll a=rand()%n; string s=to_string(a); bool ok=true; for (ll j = 0; j < s.size(); j++) { if (s[j]=='7') { ok=false; break; } } if (!ok) { continue; } ll b=n-a; s=to_string(b); for (ll j = 0; j < s.size(); j++) { if (s[j]=='7') { ok=false; break; } } if (ok) { cout << a << ' ' << b << endl; return 0; } } }