A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacen Read More
# include <cstdio> # include <cmath> # include <algorithm> using namespace std; int n, s[10]; int main(){ int i, j, k, a, b, c, ans; scanf("%d", &n); Read More
#include<iostream>using namespace std;int a[4][5];int s;//保存计数器void bck(int i, int j)//递归{ if (a[i][j] == 8){ s++; return; }//函数出口 if (i + 1 > 4 || j Read More
Color the ball Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 17654 Accepted Submission(s): 8830 Read More
#include <iostream> #include <algorithm> /// next_permutation, sort里卖弄包括两个函数,桉顺序获得下一个要排列的数,也可以自己写一个泪时的函数。。 using namespace std; int main () { char myi Read More