Skip to content

Instantly share code, notes, and snippets.

View hiroshi-cl's full-sized avatar

Hiroshi YAMAGUCHI hiroshi-cl

  • Some company
  • Tokyo, Japan
View GitHub Profile
@hiroshi-cl
hiroshi-cl / Dockerfile
Created March 3, 2019 21:54
websocket-rtmp-publisher
FROM alpine:3.9 as builder
RUN apk add --update --no-cache git nodejs-dev npm
RUN git clone https://github.com/fbsamples/Canvas-Streaming-Example.git && cd Canvas-Streaming-Example && npm install
FROM alpine:3.9 as runner
RUN apk add --update --no-cache nodejs ffmpeg
COPY --from=builder Canvas-Streaming-Example/server.js server.js
COPY --from=builder Canvas-Streaming-Example/node_modules node_modules
EXPOSE 3000
ENTRYPOINT node server.js
@hiroshi-cl
hiroshi-cl / Main.java
Last active December 27, 2015 23:59
2013年 模擬地区予選 Problem D: Everlasting -One- [Licence: NYSL Version 0.9982]
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static final int MOD = 1_000_000_007;
public static void main(final String... args) {
final Scanner sc = new Scanner(System.in);
main:
while (sc.hasNext()) {
@hiroshi-cl
hiroshi-cl / Main.java
Created November 11, 2013 09:16
2013年 模擬地区予選 Problem A: Broken Audio Signal (解法2) [Licence: NYSL Version 0.9982]
import java.util.Scanner;
public class Main {
public static void main(final String... args) {
final Scanner sc = new Scanner(System.in);
main:
while (sc.hasNext()) {
final int n = sc.nextInt();
if (n == 0)
return;
@hiroshi-cl
hiroshi-cl / Main.java
Created November 11, 2013 09:15
2013年 模擬地区予選 Problem A: Broken Audio Signal (解法1) [Licence: NYSL Version 0.9982]
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Main {
public static void main(final String... args) {
final Scanner sc = new Scanner(System.in);
main:
while (sc.hasNext()) {
final int n = sc.nextInt();
@hiroshi-cl
hiroshi-cl / Main.java
Created October 21, 2013 04:44
2013年 夏合宿4日目 Problem F : Graph Automata Player [Licence: NYSL Version 0.9982]
import java.util.*;
public class Main {
public static void main(String... args) {
final Scanner sc = new Scanner(System.in);
// input
final int N = sc.nextInt();
final boolean[][] m = new boolean[N][N];
for (int i = 0; i < N; i++)
for (int j = 0; j < N; j++)
@hiroshi-cl
hiroshi-cl / Main.java
Created October 21, 2013 04:43
2013年 夏合宿4日目 Problem B : Trodden Cable [Licence: NYSL Version 0.9982]
import java.util.*;
public class Main {
private static final int[] dx = new int[128];
private static final int[] dy = new int[128];
private static final int[] dx2 = {0, 0, 1, -1};
private static final int[] dy2 = {-1, 1, 0, 0};
static {
@hiroshi-cl
hiroshi-cl / Main.java
Created June 25, 2013 07:54
2011年 冬合宿4日目 Problem E : Rabbit Game Playing [Licence: NYSL Version 0.9982]
import static java.util.Arrays.*;
public class Main {
public static void main(String... args) {
new Main().run();
}
static final long MOD = 1000 * 1000 * 1000 + 7;
public void run() {
@hiroshi-cl
hiroshi-cl / Main.java
Created June 25, 2013 07:53
2011年 冬合宿4日目 Problem C : Fair Game [Licence: NYSL Version 0.9982]
import java.util.*;
import static java.lang.Math.*;
import static java.lang.Integer.*;
public class Main {
public static void main(String... args) {
new Main().run();
}
int n;
@hiroshi-cl
hiroshi-cl / Main.java
Created June 25, 2013 07:51
2010年 模擬地区予選 Problem D : Dice Room [Licence: NYSL Version 0.9982]
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
public class Main {
public static void main(String... args) {
new Main().run();
}
@hiroshi-cl
hiroshi-cl / Main.java
Created June 25, 2013 07:49
2010年 模擬地区予選 Problem A : Era Name [Licence: NYSL Version 0.9982]
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
public class Main {
public static void main(String... args) {
new Main().run();
}
public void run() {