Skip to content

Instantly share code, notes, and snippets.

View goish135's full-sized avatar

阿瑜 goish135

View GitHub Profile
pos = [1,2,4,7]
height = [4,6,8,10]
maxLeft = [0]*(max(pos)+1)
maxRight = [0]*(max(pos)+1)
# min(left,right)+1
total = [0]*(max(pos)+1)
'''
type 0 : -(origimnal*amount/100)
type 1 : = amount
type 2 : - amount
'''
products = [
['10','sale','january-sale'],
['200','sale','EMPTY']
]
#!/usr/bin/py
from collections import defaultdict
def hermionesWand(arr, K, max_x, max_y):
# find both entry and exit points
for idx, line in enumerate(arr):
for inner_idx in range(len(line)):
if line[inner_idx] == 'M':
start = (idx, inner_idx)
if line[inner_idx] == '*':
class Solution:
def reachableNodes(self, edges: List[List[int]], maxMoves: int, n: int) -> int:
'''
status: 7/47
Step 1: Create graph
Step 2: HP[node] = remain power
Step 3: sum of main-nodes + sub-nodes
'''
# Step 1
// Copyright 2018-present the Flutter authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
#include<iostream>
using namespace std;
int main()
{
int n,m;
cin >> n >> m; // [100,400]
int i = n;
int total = 0;
while(i<=m)
{
#include<iostream>
using namespace std;
/*
Out: num'
In: num
*/
int main()
{
int num;
List<String> strings = list.stream().map(object -> Objects.toString(object,null)).collect(Collectors.toList());
// table 1
// 有 A 才有 B
#include<iostream>
using namespace std;
int main()
{
for(int i=1;i<=7;i++)
{
for(int j=1;j<=7;j++)
{
if(!(i>=3&&i<=5)&&!(j>=3&&j<=5)&&!((i==1||i==7)&&(j==1||j==7)))
{
# -*- coding: utf-8 -*-
#from pytube import YouTube
#url = 'https://youtu.be/Ej83dvkU-Z4'
#YouTube(url).streams.first().download()
# -*- coding: utf-8 -*-
from moviepy.editor import *