結果
問題 |
No.442 和と積
|
ユーザー |
|
提出日時 | 2016-11-12 00:19:06 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 345 bytes |
コンパイル時間 | 645 ms |
コンパイル使用メモリ | 19,968 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-25 10:37:05 |
合計ジャッジ時間 | 1,333 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 12 WA * 6 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:15:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%llu%llu",&x,&y); | ^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> unsigned long long int gcd(unsigned long long int a,unsigned long long int b){ unsigned long long int c; while(b){ c = a%b; a = b; b = c; } return a; } int main(void){ unsigned long long int x,y,p,q,r; scanf("%llu%llu",&x,&y); p = gcd(x+y,x); q = gcd(x+y,y); r = gcd(x+y,p*q); printf("%llu\n",r); return 0; }