Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just found a way to do it with 57 or 58 pictures but now I have a very bad headache, I'll post the ruby code in 8-10 hours after I slept well! just a hint my my solution every 7 cards share same mark and total 56 cards can be constructed using my solution.</p> <p>here is the code that generates all 57 cards that ypercube was talking about. it uses exactly 57 pictures, and sorry guy's I've written actual C++ code but knowing that <code>vector &lt;something&gt;</code> is an array containing values of type <code>something</code> it's easy to understand what this code does. and this code generates <code>P^2+P+1</code> cards using <code>P^2+P+1</code> pictures each containing <code>P+1</code> picture and sharing only 1 picture in common, for every prime P value. which means we can have 7 cards using 7 pictures each having 3 pictures(for p=2), 13 cards using 13 pictures(for p=3), 31 cards using 31 pictures(for p=5), 57 cards for 57 pictures(for p=7) and so on...</p> <pre><code>#include &lt;iostream&gt; #include &lt;vector&gt; using namespace std; vector &lt;vector&lt;int&gt; &gt; cards; void createcards(int p) { cards.resize(0); for (int i=0;i&lt;p;i++) { cards.resize(cards.size()+1); for(int j=0;j&lt;p;j++) { cards.back().push_back(i*p+j); } cards.back().push_back(p*p+1); } for (int i=0;i&lt;p;i++) { for(int j=0;j&lt;p;j++) { cards.resize(cards.size()+1); for(int k=0;k&lt;p;k++) { cards.back().push_back(k*p+(j+i*k)%p); } cards.back().push_back(p*p+2+i); } } cards.resize(cards.size()+1); for (int i=0;i&lt;p+1;i++) cards.back().push_back(p*p+1+i); } void checkCards() { cout &lt;&lt; "---------------------\n"; for(unsigned i=0;i&lt;cards.size();i++) { for(unsigned j=0;j&lt;cards[i].size();j++) { printf("%3d",cards[i][j]); } cout &lt;&lt; "\n"; } cout &lt;&lt; "---------------------\n"; for(unsigned i=0;i&lt;cards.size();i++) { for(unsigned j=i+1;j&lt;cards.size();j++) { int sim = 0; for(unsigned k=0;k&lt;cards[i].size();k++) for(unsigned l=0;l&lt;cards[j].size();l++) if (cards[i][k] == cards[j][l]) sim ++; if (sim != 1) cout &lt;&lt; "there is a problem between cards : " &lt;&lt; i &lt;&lt; " " &lt;&lt; j &lt;&lt; "\n"; } } } int main() { int p; for(cin &gt;&gt; p; p!=0;cin&gt;&gt; p) { createcards(p); checkCards(); } } </code></pre> <p>again sorry for the delayed code.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload