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
/* PKU 1656 - Counting Black. */ | |
#include <stdio.h> | |
#include <string.h> | |
int main(void) | |
{ | |
int i = 0, m = 0; | |
int t = 0; | |
char command[6] = " "; | |
int x = 0, y = 0, L = 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
/** Graph in C. Abreto<m@abreto.net>. 未完成. */ | |
#include <stdlib.h> | |
#include <limits.h> | |
const size_t default_vertices = 30; // 默认最大顶点数 | |
typedef struct // 结点数据类型 | |
{ | |
int data; | |
}gmtx_vertices; |
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
/* NOIP2011 Day1 - carpet.c */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int i = 0, j = 0; | |
int n = 0; | |
int *a = NULL, *b = NULL, *g = NULL, *k = NULL; | |
int x = 0, y = 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
/* Chapter 02 - approximation */ | |
#include <stdio.h> | |
int main(void) | |
{ | |
int i = 0; | |
double pi_4 = 0.0, t = 0.0; | |
i = 1; | |
while( (t=1.0/(2*i-1)) >= 0.000001 ) |
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 568 - Just the Facts */ | |
#include <stdio.h> | |
int main(void) | |
{ | |
int N = 0; | |
while( scanf("%d", &N)==1 ) | |
{ | |
int i = 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) // 递归边界 |
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
/* 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
/* 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
/* 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; |