結果

問題 No.2194 兄弟の掛け引き
ユーザー ゆうP
提出日時 2024-05-12 00:20:27
言語 Go
(1.23.4)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 10,886 ms
コンパイル使用メモリ 240,004 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-20 08:55:41
合計ジャッジ時間 11,697 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.2194 兄弟の掛け引き
package main

import (
	"fmt"
	"math"
)

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	ans := []int{}
	for i := 1; i <= int(math.Pow(10, 5)); i++ {
		w := (i * a) - b
		if w > 0 {
			if w == c {
				ans = append(ans, i)
			}
		} else {
			if (i * a) == c {
				ans = append(ans, i)
			}
		}

	}
	if len(ans) == 0 {
		fmt.Println(-1)
	} else {
		for _, v := range ans {
			fmt.Println(v)
		}
	}
}
0