Skip to content

Instantly share code, notes, and snippets.

@dryadh01120
dryadh01120 / Radar Installation.cpp
Created February 3, 2018 09:38
[UVa] 1193 - Radar Installation
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int n, i;
pair<double, double> island[1005];
int solve() {
@dryadh01120
dryadh01120 / Copying Books.c
Created January 30, 2018 17:24
[UVa] 714 - Copying Books
#include <stdio.h>
#include <string.h>
int i, m, k, p[505];
long long int upper, lower;
void solve() {
int cnt, slash[505];
long long int mid, sum;
@dryadh01120
dryadh01120 / What Day Is It.c
Created January 28, 2018 17:35
[UVa] 602 - What Day Is It?
#include <stdio.h>
int m, d, y;
int month[13]={0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
char weekName[7][10]={"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
char monthName[13][10] = {"", "January","February","March","April","May","June",
"July","August","September","October","November","December"};
int isLeap(int x) {
return x <= 1752 ? x % 4 == 0 : (x % 4 == 0 && x % 100 != 0) || x % 400 == 0;
@dryadh01120
dryadh01120 / Find them, Catch them.c
Created January 26, 2018 17:11
[POJ] 1703 - Find them, Catch them
#include <stdio.h>
#include <string.h>
int N, M;
int c[100005];
int e[100005];
void init() {
int i;
for(i = 0; i <= N; ++i) {
@dryadh01120
dryadh01120 / Oulipo.c
Created January 23, 2018 16:25
[POJ] 3461 - Oulipo
#include <stdio.h>
#include <string.h>
int f[10005];
char W[10005];
char T[1000005];
int solve() {
int i, j = -1, ans = 0;
int wlen = strlen(W);
@dryadh01120
dryadh01120 / Self Numbers.c
Created January 21, 2018 14:16
[UVa] 640 - Self Numbers
#include <stdio.h>
#include <string.h>
int selfNumber[1000005];
int main(void)
{
int i, x, t;
memset(selfNumber, 1, sizeof(selfNumber));
@dryadh01120
dryadh01120 / ID Codes.c
Created January 21, 2018 10:16
[UVa] 146 - ID Codes
#include <stdio.h>
#include <string.h>
int main(void)
{
char str[55];
while(scanf("%s", str)!=EOF && str[0]!='#')
{
int i, j, k, t;
@dryadh01120
dryadh01120 / Generating Fast.c
Created January 21, 2018 10:14
[UVa] 10098 - Generating Fast
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int cmp(const void *a, const void *b)
{
return *(char*)a - *(char*)b;
}
int main(void)
@dryadh01120
dryadh01120 / Game of Connections.c
Created January 21, 2018 10:12
[POJ] 2084 - Game of Connections
#include <stdio.h>
#include <string.h>
int main(void)
{
int catalan[105][200], i, j;
memset(catalan, 0, sizeof(catalan));
catalan[0][0]=1;
@dryadh01120
dryadh01120 / Frogger.c
Created January 21, 2018 10:10
[POJ] 2253 - Frogger
#include <stdio.h>
#include <math.h>
int main(void)
{
int n, casenum=1;
while(scanf("%d", &n) && n!=0)
{
int i, j, k, flag[205][205]={0}, stone[205][2];