結果
問題 |
No.544 Delete 7
|
ユーザー |
![]() |
提出日時 | 2017-07-14 22:53:39 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 622 bytes |
コンパイル時間 | 4,009 ms |
コンパイル使用メモリ | 86,876 KB |
実行使用メモリ | 56,876 KB |
最終ジャッジ日時 | 2024-10-07 23:22:57 |
合計ジャッジ時間 | 17,505 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 3 |
other | AC * 18 WA * 30 |
ソースコード
import java.util.*; public class No543 { public static void main(String[] args) { try (final Scanner sc = new Scanner(System.in)) { long n = sc.nextInt(); Random random = new Random(); while (true) { long a = random.nextInt(); long b = n - a; if ((a+"").indexOf('7') < 0 && (b+"").indexOf('7') < 0) { System.out.println(a + " " + b); break; } } } } static long gcd(long n, long r) { return r == 0 ? n : gcd(r, n % r); } static long lcm(long n, long r) { return n/gcd(n,r)*r; } static void dump(Object... objects) { System.err.println(Arrays.deepToString(objects)); } }