結果
問題 | No.442 和と積 |
ユーザー |
|
提出日時 | 2018-09-28 18:47:25 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 394 bytes |
コンパイル時間 | 127 ms |
コンパイル使用メモリ | 28,672 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 23:15:19 |
合計ジャッジ時間 | 972 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include <stdio.h>long gcd(__int128 x, __int128 y){__int128 r;if (y > x) {r = x;x = y;y = r;}while (y > 0) {r = x % y;x = y;y = r;}return x;}int main(void){long A, B;scanf("%ld%ld", &A, &B);printf("%ld", gcd(A + B, (__int128)A * B));puts("");return 0;}