結果
| 問題 |
No.544 Delete 7
|
| コンテスト | |
| ユーザー |
hiro71687k
|
| 提出日時 | 2023-09-04 15:58:53 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 981 bytes |
| コンパイル時間 | 3,866 ms |
| コンパイル使用メモリ | 252,308 KB |
| 最終ジャッジ日時 | 2025-02-16 18:35:46 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 TLE * 1 -- * 2 |
| other | -- * 48 |
コンパイルメッセージ
main.cpp:9:8: warning: overflow in conversion from ‘long int’ to ‘ll’ {aka ‘int’} changes value from ‘100990999999999909’ to ‘-2004684891’ [-Woverflow]
9 | ll inf=100990999999999909;
| ^~~~~~~~~~~~~~~~~~
ソースコード
#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=100990999999999909;
int main(){
srand((unsigned)time(NULL));
ll n;
cin >> n;
for (ll i = 0; i >=0; i++)
{
ll a=rand();
if (a>n)
{
continue;
}
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;
}
}
}
hiro71687k