結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
コンテスト
ユーザー tatt61880
提出日時 2021-03-20 18:11:32
言語 Kuin
(KuinC++ v.2021.9.17)
コンパイル:
kuinc -i _filename_ -o out.cpp -s /kuin/sys/ -e cpp -r -q
実行:
./a.out
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 838 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,410 ms
コンパイル使用メモリ 168,124 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-05 17:03:27
合計ジャッジ時間 2,238 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
out.cpp:676:14: warning: first argument in call to 'memset' is a pointer to non-trivially copyable type 'std::shared_ptr<k_an>' [-Wnontrivial-memcall]
  676 |                         memset(r->B, 0, sizeof(T) * static_cast<std::size_t>(h + bufLen_<T>()));
      |                                   ^
out.cpp:688:9: note: in instantiation of function template specialization 'newArraysRec_<std::shared_ptr<Array_<std::shared_ptr<k_an>>>>::operator()<long long>' requested here
  688 |         return newArraysRec_<T>()(std::forward<A>(a)...);
      |                ^
out.cpp:1630:11: note: in instantiation of function template specialization 'newArrays_<std::shared_ptr<Array_<std::shared_ptr<k_an>>>, long long>' requested here
 1630 | (k_am) = (newArrays_<type_(Array_<type_(k_an)>)>((3LL)));
      |           ^
out.cpp:676:14: note: explicitly cast the pointer to silence this warning
  676 |                         memset(r->B, 0, sizeof(T) * static_cast<std::size_t>(h + bufLen_<T>()));
      |                                   ^
      |                                (void*)
1 warning generated.

ソースコード

diff #
raw source code

func main()
	var pos: []Pos :: #[3]Pos
	for i(0, 2)
		do pos[i] :: (#Pos).init(cui@inputInt(), cui@inputInt())
	end for
	for i(0, 2)
		if(i <> 0)
			var t: Pos :: ##pos[0]
			do pos[0] :: ##pos[i]
			do pos[i] :: ##t
		end if
		if((pos[1].x - pos[0].x) * (pos[2].x - pos[0].x) + (pos[1].y - pos[0].y) * (pos[2].y - pos[0].y) = 0)
			if((pos[1].x - pos[0].x) ^ 2 + (pos[1].y - pos[0].y) ^ 2 = (pos[2].x - pos[0].x) ^ 2 + (pos[2].y - pos[0].y) ^ 2)
				do cui@print("\{pos[2].x + pos[1].x - pos[0].x} \{pos[2].y + pos[1].y - pos[0].y}\n")
				ret
			end if
		end if
	end for
	do cui@print("-1\n")
	
	func swap(a: &Pos, b: &Pos)
		var pos: Pos :: ##a
		do a :: ##b
		do b :: ##pos
	end func
	
	class Pos()
		+var x: int
		+var y: int
		+func init(x: int, y: int): Pos
			do me.x :: x
			do me.y :: y
			ret me
		end func
	end class
end func
0