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
| /* | |
| * building isprime table and prime_seq table | |
| * build 10^6 isprime + prime_seq table cost <0.1 sec | |
| * seq_top means the total numer in prime_seq ( 1~10^6 : 78498 prime ) | |
| * isprime: false false true true false TRUE ... | |
| * 0 1 2 3 4 5 | |
| * prime_seq: 2 3 5 7 11 13 ... | |
| * | |
| * example: | |
| * 1. check if 234567 is a prime => Yes |
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
| /* | |
| * dp problem - coin change | |
| * change[n]: number of ways to make change of n with coin_set given | |
| * | |
| * example | |
| * with coin set {1,5,10,25,50} | |
| * There are 2050869227 ways to make change of 7400 | |
| */ | |
| #include <stdio.h> | |
| #include <string.h> |
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
| /* | |
| * bigmod: caculate ( base ^ power ) mod modular | |
| * usage: bigmod ( base, power, modular); | |
| * | |
| * input: base, power, modular | |
| * output: return value | |
| * | |
| * example: print value of ( 2374859 ^ 3029382 ) % 36123 | |
| * output 13195 | |
| */ |
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
| public class code | |
| { | |
| public static int pow2(int power) | |
| { | |
| int ret = 1; | |
| for(int t=0;t<power;t++) | |
| ret <<= 1; | |
| return ret; | |
| } |
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
| %{ | |
| int yywarp(void); | |
| %} | |
| %% | |
| %% | |
| int main() | |
| { | |
| yylex(); | |
| return 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
| /* | |
| * SPFA - Shortest Path Faster Algorithm | |
| */ | |
| #include <cstdio> // printf | |
| #include <cstdlib> // NULL | |
| #include <algorithm> // fill | |
| #include <vector> | |
| #include <queue> | |
| using namespace std; |
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
| Read: x | |
| If | |
| Op: < | |
| Const: 0 | |
| Id: x | |
| Assign to: fact | |
| Const: 1 | |
| Repeat | |
| Assign to: fact | |
| Op: * |
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 <termios.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| int kbhit(void) | |
| { | |
| struct termios oldt, newt; | |
| int ch; | |
| int oldf; |
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 java.awt.BorderLayout; | |
| import javax.swing.JButton; | |
| import javax.swing.JFrame; | |
| import javax.swing.JPanel; | |
| import javax.swing.JTable; | |
| public class LayoutTest extends JFrame{ | |
| public static final int x_start = 150, y_start = 100; | |
| public static final int WIDTH = 500, HEIGHT = 150; |
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
| * Standard prelude: | |
| 0: LD 6,0(0) load maxaddress form location 0 | |
| 1: ST 0,0(0) clear location 0 | |
| * End of standard prelude | |
| 2: LDA 0,1(7) save return address in ac | |
| 4: HALT 0,0,0 program end | |
| 5: ST 0,-1(6) start function code section(save return address) | |
| 6: LDC 0,1(0) ac = 1 | |
| * One instruction's place is reserved here |
OlderNewer