0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ASP 例題0 組み合わせ

Last updated at Posted at 2020-02-16

問題

p(1)からp(5)までの5つの中から、2つ選ぶ組み合わせはいくつか?

回答

example0.lp
{p(1..5)}=2.

解説

Potassco guideを読んでも、まったくわからなかった。
{}で囲まれな中は
{p(1);p(2);p(3);p(4);p(5)}に展開され、
#count {p(1):p(1);p(2):p(2);p(3):p(3);p(4):p(4);p(5):p(5)}=2.と変換されるらしい。

組み合わせをすべて求めるためには、実行時に0をつける

> clingo example0.lp 0

他の問題

ASP個人的ポータル

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?