Skip to content

Instantly share code, notes, and snippets.

View 02015678's full-sized avatar

02015678 02015678

View GitHub Profile
@02015678
02015678 / 2007101101.c
Last active August 29, 2015 14:13
GCC Solution for NKPC3 Bowling Ball
#include<stdio.h>
int ans=-1;
char k=0,i,a[21];
short pts=-1;
char chk(short pts)
{
char tmp;
switch(a[pts])
{
case 'X':tmp=10;break;
@02015678
02015678 / 2007101102.pas
Last active August 29, 2015 14:13
PASCAL Solution for NKPC3 Bowling Ball
Const
ch1:set of char=['/','-','X','1'..'9']; {记分的有效符号}
Var
pnt,k,i,j:byte; {(总计)击球次数的指针:p(oi)nt}
ans:integer; {得分:ans(wer)}
a:array[1..11,1..21]OF char; {存储每一次记分字符的数组:a(rray)}
ch:char; {用于读取输入文件的字符变量:ch(ar)}
Function chk(k,pnt:byte):byte; {求(总计)第n次击球击倒的个数:ch(ec)k}
Begin
Case a[k,pnt] OF
@02015678
02015678 / 2007101103.pas
Created January 18, 2015 15:20
Liuhy's PASCAL Solution for NKPC3 Bowling Ball
program NK1704;
var
st:array [1..1000] of char;
score:array [0..10] of integer;
i,tt,line:integer;
qq,ch:char;
procedure main;
var
i,j,th:integer;
a:array [1..10,1..2] of integer;
@02015678
02015678 / 2013120101.m
Created January 20, 2015 16:34
Matlab program for LU Factorization with partial (row) pivoting
function [L,U,P]=LU_pivot(A)
% LU factorization with partial (row) pivoting
% K. Ming Leung, 02/05/03
[n,n]=size(A);
L=eye(n); P=L; U=A;
for k=1:n
[pivot m]=max(abs(U(k:n,k)));
m=m+k-1;
if m~=k
@02015678
02015678 / 2014090801.bat
Created January 20, 2015 16:36
在Visual Studio 2005/2008/2010下使用MSCOMM32
:: This Batch file is used to install MSCOMM32
::
@echo off
echo CLAIM: MSCOMM32 is belong to Microsoft Corporation
echo.
echo This batch file is licensed under CC-BY-SA 3.0
echo and is provided on an "AS IS" basis, use it on your own risk.
echo.
@02015678
02015678 / 2013100302.cpp
Created January 20, 2015 16:40
[转载]C++中稀疏矩阵的一种实现
#include <iostream>
#include <iomanip>
using namespace std;
template<class T>
//三元组
struct Trituple
{
int row;
int col;
@02015678
02015678 / 2007082601.pas
Created January 23, 2015 12:53
NKOJ 1781: ISBN
Var
a:array[1..10]OF 0..10;
str:string;
n,i,s:integer;
Function cal(x,y:integer):integer;
Var
i:integer;
ans:integer;
Begin
ans:=0;
@02015678
02015678 / 2007082602.pas
Created January 23, 2015 12:54
NKOJ 1781: ISBN Liuhy
program ISBN;
uses CRT;
var
d:array [1..10] of integer;
i,unk,sumn,ans,t:integer;
b:boolean; s:string;
begin
sumn:=0;
readln(s);
for i:=1 to 10 do
@02015678
02015678 / 2007050301.pas
Last active August 29, 2015 14:14
Translation between different Positional notations 负进制转换 NOIP 2000-1
//https://joeyaochou.wordpress.com/2015/01/23/translation-between-different-positional-notations-%E8%B4%9F%E8%BF%9B%E5%88%B6%E8%BD%AC%E6%8D%A2-noip-2000-1/
const
maxn=50;{数组限制}
ch:string[20]='0123456789ABCDEFGHIJ';{A=10 B=11 ...}
var
i,j,n,m,k:longint;
bit:array[0..maxn] of longint;
{纪录每一位的 纯数值(A B...暂用数值表示)}
begin
@02015678
02015678 / 2007030101.pas
Last active August 29, 2015 14:14
NK1009 NKPC2 Lucy's Problem Liuhy Solution
Var
a,b,m:string;
i:integer;
x,y:longint;
Procedure f(var n:string);
Begin
m:='';For i:=length(n) downto 1 do m:=m+n[i];n:=m;
End;
BEGIN
readln(a);