Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <map>
#include <string>
using namespace std;
map<string,int> table;
void print()
{
#include <cstdio>
#include <map>
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <algorithm>
#define MAX_LEN 128
* Standard prelude:
0: LD 5,0(0) load maxaddress form dmem[0]
1: ST 0,0(0) clear dmem[0]
* End of standard prelude
* One instruction's place is reserved here
3: LDA 0,4(7) eax = return addr of main
4: LDC 2,1(2) pushl: push return addr of main
5: SUB 3,3,2 pushl
6: ST 0,0(3) pushl
* One instruction's place is reserved here
* Standard prelude:
0: LD 5,0(0) load maxaddress form dmem[0]
1: ST 0,0(0) clear dmem[0]
* End of standard prelude
2: LDA 3,0,5 reserved places for global variables
3: LDA 0,4(7) eax = return addr of main
4: LDC 2,1(2) pushl: push return addr of main
5: SUB 3,3,2 pushl
6: ST 0,0(3) pushl
7: LDA 7,143(7) jump to main
statement:
switch_stmt | case_label | compound_statement
;
switch_stmt:
SWITCH '(' expression ')' statement
;
case_label:
CASE NUM ':'
* Standard prelude:
0: LD 5,0(0) load maxaddress form dmem[0]
1: ST 0,0(0) clear dmem[0]
* End of standard prelude
2: LDA 3,0,5 reserved places for global variables
3: LDA 0,4(7) eax = return addr of main
4: LDC 2,1(2) pushl: push return addr of main
5: SUB 3,3,2 pushl
6: ST 0,0(3) pushl
7: LDA 7,1(7) jump to main
1
4 21
AA
AB
ACA
ADB
ADD
BA
BBB
BBD
#include <cmath> // sqrt
#include <cassert> // assert
#include <algorithm> // max, min
using namespace std;
const double eps = 1e-6;
struct Cord{
double x, y;
@pcyu16
pcyu16 / linked_list_trie.cpp
Created July 31, 2010 20:41
trie in linked list
#include <cstdio>
#include <cstdlib>
#include <string>
#include <fstream>
#include <iostream>
//#define DEBUG
using namespace std;
Slote Max Min Average
1 108 56 99
2 110 98 104
3 188 101 119
4 199 89 157
5 225 145 187
6 221 104 191
7 242 163 200
8 242 164 208
9 231 163 200