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
/* Wikioi - Problem 1040 count the number of words; . by Abreto. */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define MAX_CHARS (201) | |
#define MAX_WORDS (7) | |
int k = 0, s = 0; | |
char str[MAX_CHARS] = {0}; | |
int nstrchrs = 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
/* Wikioi - Proeblem 1039 . by Abreto. */ | |
#include <stdio.h> | |
#define MAXN 200 | |
#define MAXK 6 | |
int f[MAXN+1][MAXN+1][MAXK+1] = {{{0}}}; | |
int | |
dp(int i, int n, int k) | |
{ |
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
/* Wikioi - Problem 1017 Maxmul. by Abreto. */ | |
#include <stdio.h> | |
#define MAXL (50) | |
#define MAXK (10) | |
typedef long long int lint; | |
int N = 0, K = 0; | |
char a[MAXL] = {0}; | |
lint g[MAXL][MAXL] = {{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
/* Wikioi - Problem 1200 Equation. by Abreto. */ | |
#include <stdio.h> | |
#define ABS(x) ( ((x)>0) ? (x) : (-(x)) ) | |
int exgcd(int m, int n, int * x) | |
{ | |
int q = 0; | |
int x0 = 1, x1 = 0; | |
int t = 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
/* Wikioi - Problem 1169 Passing notes. */ | |
#include <stdio.h> | |
#define MAX(a,b) ( ((a)>(b))?(a):(b) ) | |
#define MAX4(a,b,c,d) (MAX(MAX((a),(b)),MAX((c),(d)))) | |
#define MAXSIZE 52 | |
int m = 0, n = 0; | |
int mat[MAXSIZE][MAXSIZE] = {{0}}; | |
int f[MAXSIZE][MAXSIZE][MAXSIZE] = {{{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
/* Wikioi - Problem 1010 Dabing crossing the river. */ | |
#include <stdio.h> | |
#define CONTROLEDBYHORSE(i, j) ( (X == (i) && Y == (j)) || (X-1 == (i) && Y-2 == (j)) || (X-2 == (i) && Y-1 == (j)) || (X-2 == (i) && Y+1 == (j)) || (X-1 == (i) && Y+2 == (j)) || (X+1 == (i) && Y-2 == (j)) || (X+2 == (i) && Y-1 == (j)) || (X+2 == (i) && Y+1 == (j)) || (X+1 == (i) && Y+2 == (j)) ) | |
#define OUTOFBOARD(i, j) ( ((i) > n) || ((j) > m) ) | |
typedef long long int lint; | |
int n = 0, m = 0; | |
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
/* Wikioi - Problem 1048 */ | |
#include <stdio.h> | |
#include <limits.h> | |
int n = 0; | |
int M[101][101] = {{0}}; | |
int w[101] = {0}; | |
int S[101] = {0}; | |
int dp(int left, int right) |
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
/* Wikioi - Problem 1154. by Abreto. */ | |
#include <stdio.h> | |
#define POSITION(i) ( (i) % N ) | |
int N = 0; | |
int mark[201] = {0}; | |
int M[201][201] = {{0}}; | |
int | |
dp(int h, int 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
/* simulate memory management. Abreto 20130806. */ | |
#ifndef NULL | |
#define NULL ( 0 ) | |
#endif | |
/* Memory size: 64KiB. */ | |
#define _MEMORY_SIZE ( 64 * 1024 ) | |
/* Maxium number of blocks. */ | |
#define _BLOCK_NUM ( _MEMORY_SIZE/4 ) |
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 110201 - Jolly Jumper */ | |
#include <stdio.h> | |
#include <string.h> | |
#define ABS(x) ( ((x)>0) ? (x) : (-(x)) ) | |
char bits[3002] = {0}; | |
int main(void) | |
{ | |
int n = 0; |