Skip to content

Instantly share code, notes, and snippets.

@autekroy
autekroy / UVa OJ - 572 Oil Deposits.cpp
Last active August 29, 2015 13:58
UVa Online Judge
//This program is for UVA 572 Oil Deposits
//Problem link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=7&page=show_problem&problem=513
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 101
using namespace std;
//This program is for NTHU 5710 Stack
//題目來源 Problem link: http://140.114.86.38/problem.php?pid=5710
#include<iostream>
#include<stdio.h>
#include<stack>
#include<string.h>
using namespace std;
stack<int> s;
//This program is for NTHU 5711 Queue
//Problem link: http://140.114.86.38/problem.php?pid=5711
#include<stdio.h>
#include<queue>
#include<string.h>
using namespace std;
queue<int> q;
@autekroy
autekroy / Google Code Jam Qualification Round 2014 - Problem A. Magic Trick.cpp
Last active August 29, 2015 13:59
Google Code Jam Qualification Round 2014 - Problem A. Magic Trick
//Google Code Jam Qualification Round 2014 - Problem A. Magic Trick
//https://code.google.com/codejam
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
freopen ("a_output.txt","w",stdout);
@autekroy
autekroy / Google Code Jam Qualification Round 2014 - Problem B. Cookie Clicker Alpha.cpp
Created April 13, 2014 09:04
Google Code Jam Qualification Round 2014 - Problem B. Cookie Clicker Alpha
@autekroy
autekroy / Animate_Your_Name.html
Created April 13, 2014 12:00
Animate Your Name
<!DOCTYPE html>
<html>
<head>
<title>Animate Your Name</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/alphabet.js"></script>
</head>
<body>
<canvas id="myCanvas"></canvas>
<script type="text/javascript" src="http://s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/bubbles.js"></script>
@autekroy
autekroy / 416A Guess a number!.cpp
Last active August 29, 2015 13:59
Codeforces 416A Guess a number!
//This program is for Codeforces 416A Guess a number!
//題目來源 Problem link: http://codeforces.com/problemset/problem/416/A
/** my mistakes from code on paper
compiler errers:
1. reduceRange(char[] oper) --> reduceRange (char* oper)
2. char[] reverseOper(char op) --> char* reverseOper(char* op)
3. declare function reverseOper after the function reduceRange
@autekroy
autekroy / ACM-ICPC 4660 - A+B.cpp
Created April 19, 2014 16:20
ACM-ICPC 4660 - A+B
//This program is for ACM-ICPC 4660 - A+B
//Problem link: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=29&page=show_problem&problem=2661
#include<stdio.h>
#include<string.h>
using namespace std;
int changeBase(int n, int base)
{
int len, sum = 0, tmp;
@autekroy
autekroy / Google Code Jam Round 1B 2014 - Problem A.The Repeater (small input).cpp
Created May 4, 2014 07:29
Google Code Jam Round 1B 2014 - Problem A.The Repeater (small input)
//Google Code Jam Round 1B 2014 - Problem A.The Repeater (small input)
//https://code.google.com/codejam
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
using namespace std;
int findAns(char* str1, char* str2, int len1, int len2)
@autekroy
autekroy / Google Code Jam - Round 1B 2014 - Problem B.New Lottery Game (small input).cpp
Created May 4, 2014 07:34
Google Code Jam - Round 1B 2014 - Problem B.New Lottery Game (small input)
//Google Code Jam - Round 1B 2014 - Problem B.New Lottery Game (small input)
//https://code.google.com/codejam
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
using namespace std;
int main()