結果
| 問題 | No.442 和と積 | 
| コンテスト | |
| ユーザー |  fps_Alvin | 
| 提出日時 | 2017-04-05 17:36:20 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 505 bytes | 
| コンパイル時間 | 97 ms | 
| コンパイル使用メモリ | 28,032 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-08 10:52:26 | 
| 合計ジャッジ時間 | 688 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| other | AC * 7 WA * 11 | 
ソースコード
#include <stdio.h>
int main(void)
{
	unsigned long long A,B,surplus = 1,left,right,most_anser;
	scanf("%llu %llu",&A,&B);
//				printf("%llu %llu\n",A, B);
	if(A+B < A*B){
		right = A+B;
		left = A*B;
	}else{
		right = A*B;
		left = A+B;
	}
	//		printf("%llu %llu\n",left, right);
	while(surplus != 0){
		surplus = left % right;
		//最大公約数を保存
		most_anser = right;
		left = right;
		right = surplus;
	//		printf("%llu %llu\n",left, right);
	}
	
	printf("%llu\n",most_anser);
	return 0;
}
            
            
            
        