Skip to content

Instantly share code, notes, and snippets.

View aliciawyy's full-sized avatar

Alice Wang aliciawyy

  • Paris, France
  • 13:22 (UTC +02:00)
View GitHub Profile
<?php
//List the folders using ls
echo shell_exec("ls / -ltr");
?>
@aliciawyy
aliciawyy / 10107_median.cpp
Created July 28, 2019 21:35
UVa 10107 What is the median
#include <bits/stdc++.h>
using namespace std;
int main() {
int m;
bool is_from_max_heap = true;
priority_queue<int, vector<int>> max_heap;
priority_queue<int, vector<int>, greater<int>> min_heap;
while (cin >> m) {
@aliciawyy
aliciawyy / 11988_broken_keyboard.cpp
Created July 28, 2019 19:07
UVa 11988 Broken Keyboard
#include <bits/stdc++.h>
using namespace std;
/* Solve the problem with double-linked list
* We just need to record and update the next position to insert
* the character.
*/
int main() {
string line;
while (getline(cin, line)) {
@aliciawyy
aliciawyy / wormholes_v2.cpp
Created June 12, 2019 15:51
wormholes v2 AC
/*
ID: raining5
PROG: wormhole
LANG: C++
*/
// Version 2 after reading the solution
#include <bits/stdc++.h>
#define N_MAX 12
using namespace std;
@aliciawyy
aliciawyy / combo.cpp
Created June 12, 2019 09:37
combo.cpp
//
// Created by alice on 11/06/19.
//
/*
ID: raining5
PROG: combo
LANG: C++
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include <bits/stdc++.h>
@aliciawyy
aliciawyy / usaco_1_4_wormholes.cpp
Last active June 12, 2019 09:36
usaco_1_4_wormholes
//
// Created by alice on 11/06/19.
// USACO 1.4 Wormholes
// AC
//
/*
ID: raining5
PROG: wormhole
LANG: C++
*/
@aliciawyy
aliciawyy / 861_little_bishops.cpp
Created June 9, 2019 11:59
UVa 861 - Little Bishops
//
// Created by alice on 08/06/19.
// UVa 861 - Little Bishops
// Accepted 0.000s
//
#define N 9
#include <bits/stdc++.h>
using namespace std;
@aliciawyy
aliciawyy / freckles.cpp
Created May 27, 2019 11:58
kruskal algorithm implementation for uva freckles problem
//
// Created by alice on 27/05/19.
// g++ freckles_10034.cpp -o freckles.o
// uva - 10034 accepted
//
#include <bits/stdc++.h>
using namespace std;
@aliciawyy
aliciawyy / accountsMerge.py
Last active October 20, 2018 18:44
accountsMerge
from collections import defaultdict
class Solution:
def accountsMerge(self, accounts):
"""
:type accounts: List[List[str]]
:rtype: List[List[str]]
"""
graph = defaultdict(set)
@aliciawyy
aliciawyy / max-points-on-a-line.py
Last active October 19, 2018 10:43
max-points-on-a-line
# Definition for a point.
# class Point:
# def __init__(self, a=0, b=0):
# self.x = a
# self.y = b
# 68ms
# Definition for a point.
# class Point:
# def __init__(self, a=0, b=0):
# self.x = a