This file contains hidden or 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
// Source : http://www.math.wustl.edu/~victor/mfmm/compaa/gcd.c | |
/* Standard C Function: Greatest Common Divisor */ | |
int | |
gcd ( int a, int b ) | |
{ | |
int c; | |
while ( a != 0 ) { | |
c = a; a = b%a; b = c; | |
} |
This file contains hidden or 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
" This line should not be removed as it ensures that various options are | |
" properly set to work with the Vim-related packages available in Debian. | |
runtime! debian.vim | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin('~/.vim/bundle/Vundle.vim') |
This file contains hidden or 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
import socket, select, sys, os | |
if __name__ == "__main__": | |
# list to keep track of socket descriptors | |
CONNECTION_LIST = [] | |
# list to keep clint id | |
CLIENT_ID = {} | |
total_client = 0 |
This file contains hidden or 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
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
#include <algorithm> | |
#define garis printf("---------------------------------------------------------\n") | |
#define garis2 printf("|=======================================================|\n") | |
struct hasil_jarak{ | |
int index; | |
double jaraknya; | |
}; |
This file contains hidden or 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
import os | |
def DEL(path) | |
os.remove(path) | |
# manggil fungsi DEL, cara ngeceknya | |
DEL("/ini/yang/dihapus.txt") | |
# Kalau yang di atas itu cuma buat ngapus file, gak bisa folder. | |
# Jadi nanti di dalam fungsi DEL itu bisa ngapus buat file sama folder. |
This file contains hidden or 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
#include <stdio.h> | |
#include <math.h> | |
const int data_total=6; | |
const int max_data=3; | |
/*double data_training[data_total][max_data]={ | |
{1,1,0,0}, | |
{0,0,0,1}, | |
{1,0,0,0}, | |
{0,0,1,1} |
This file contains hidden or 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
#include <stdio.h> | |
#include <string.h> | |
int main(){ | |
char data[100]; | |
scanf("%s", data); | |
int Q=0, W=0, E=0, i, awal=0; | |
for(i=0; i<strlen(data); i++){ | |
//printf("%c %d %d %d %d\n", data[i], Q, W, E, awal); | |
if(data[i]=='R'){ |
This file contains hidden or 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
#include <stdio.h> | |
// Cara 1 (Slow) (TLE) | |
void hitung1(int hari, int berat, int maks_hari, unsigned int *total){ | |
//printf("%d %d %d\n", hari, maks_hari, *total); | |
if(hari>maks_hari) | |
return; | |
if(berat==1) | |
*total = *total + 1; |
This file contains hidden or 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
BEAUTIFUL_VIEW = 1; | |
PC_1 = [ 57, 49, 41, 33, 25, 17, 9, | |
1, 58, 50, 42, 34, 26, 18, | |
10, 2, 59, 51, 43, 35, 27, | |
19, 11, 3, 60, 52, 44, 36, | |
63, 55, 47, 39, 31, 23, 15, | |
7, 62, 54, 46, 38, 30, 22, | |
14, 6, 61, 53, 45, 37, 29, | |
21, 13, 5, 28, 20, 12, 4 ]; |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct node { | |
int data; | |
struct node *left, | |
*right, | |
*parent; | |
}node_t; |
OlderNewer