This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* PC 110203 - Hartals */ | |
#include <stdio.h> | |
int main(void) | |
{ | |
int T = 0; | |
scanf("%d", &T); | |
while (T--) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Euclid Algorithm | |
def gcd(m, n): | |
while n != 0: | |
t = m | |
m = n | |
n = t % n | |
return m | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* UVa 488 - Triangle Wave. */ | |
#include <stdio.h> | |
int main() | |
{ | |
int i = 0, j = 0, k = 0; | |
int T = 0; | |
int A = 0, F = 0; | |
int fcount = 0; | |
int h = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* UVa OJ. 445 - Marvelous Mazes. */ | |
#include <stdio.h> | |
#include <string.h> | |
int main() | |
{ | |
int i = 0, j = 0; | |
char line[150], out; | |
int sum; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Bianchengla - Problem 1204. */ | |
#include <stdio.h> | |
long long int C[20][20] = { | |
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}, | |
{0,1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,153,171,190}, | |
{0,0,1,4,10,20,35,56,84,120,165,220,286,364,455,560,680,816,969,1140}, | |
{0,0,0,1,5,15,35,70,126,210,330,495,715,1001,1365,1820,2380,3060,3876,4845}, | |
{0,0,0,0,1,6,21,56,126,252,462,792,1287,2002,3003,4368,6188,8568,11628,15504}, | |
{0,0,0,0,0,1,7,28,84,210,462,924,1716,3003,5005,8008,12376,18564,27132,38760}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Bianchengla - Problem 1268. */ | |
#include <stdio.h> | |
int count(int distance); | |
int count_val[40] = {0}; | |
int main() | |
{ | |
int N = 0; | |
int start = 0, end = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* UVa 490 - Rotating Sentences. */ | |
#include <stdio.h> | |
#include <string.h> | |
int main() | |
{ | |
int i = 0, j = 0; | |
int N = 0; | |
char sentences[100][100]; | |
int length[100] = {0}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* NOIP2012 Day1 - Vigenere */ | |
#include <stdio.h> | |
#include <string.h> | |
#include <ctype.h> | |
#define Rni(ci, ki) ( (ci)-(ki)+((ci)<(ki)?(26):0) ) | |
char M[100]; | |
char K[100]; | |
char C[100]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* UVaOJ 10167 - Birthday Cake */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
int is_available(int a, int b); | |
int N = 0; | |
int x[100]={0}, y[100]={0}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void swap(int *a, int *b) | |
{ | |
int t = *a; | |
*a = *b; | |
*b = t; | |
} | |
void permutation(int *S, int start, int end, int *A, int cur) | |
{ | |
int i = 0; | |
if(start == end) // 递归边界 |