Loop competition calendar, competition calendar

Source: Internet
Author: User

Loop competition calendar, competition calendar
W[Problem description]W has N players in the loop, where N = 2 M, each contestant is required to compete with other N-1 players once, each contestant once a day, round Robin for a total of N-1 days, requiring no players every day round. W input: Mw output: Table-based competition schedule table w[Example input]Match. inW 3 w[Sample output]Match. outW 1 2 3 4 5 6 7 8 w 2 1 4 3 6 5 8 7 w 3 4 1 2 8 5 6 w 4 3 2 1 8 7 6 5 w 5 6 7 8 1 2 3 4 w 6 5 8 7 2 1 4 3 w 7 8 6 3 4 1 2 w 8 6 5 4 2 1

1 # include <cstdio> 2 const int MAXN = 33, MAXM = 5; 3 int matchlist [MAXN] [MAXN]; 4 int m; 5 int main () 6 {7 printf ("Input m:"); 8 scanf ("% d", & m); 9 int n = 1 <m, k = 1, half = 1; // 1 <m is equivalent to 2 ^ m10 matchlist [0] [0] = 1; 11 while (k <= m) 12 {13 for (int I = 0; I 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.