Skip to content

Instantly share code, notes, and snippets.

View Naba0123's full-sized avatar
🎹

Jumpei Miyamoto Naba0123

🎹
View GitHub Profile
<?php
# 霧島京子
// 配列数は要らない
fgets(STDIN);
// 盤面
$cells = explode(' ', trim(fgets(STDIN)));
$goal = count($cells) - 1;
$comeflag = array_fill(0, count($cells), false);
<?php
// 六村リオ
# コーヒーを$amount味見をする
function drinkCoffee($amount)
{
global $water;
global $coffee;
// 味見をする量の方が多い場合は量は0となる
@Naba0123
Naba0123 / tsubame.php
Created September 19, 2015 07:16
POH! 6
<?php
// 緑川つばめ
$input = trim(fgets(STDIN));
$result = $input;
$result += floor($input / 10);
$result += $input % 10;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
int i = -1;
String out = "";
while (i++ < line.length() - 1) {
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
String rs = "";
while ((rs = br.readLine()) != null) {
line += rs + "\n";
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
// 入力
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String rs = "";
rs = br.readLine();
@Naba0123
Naba0123 / system-cpu-log
Created February 5, 2018 13:39
1日のCPU平均使用率をツイートする
#!/bin/bash
mpstat 1 1 | sed -n '4,4p' | awk '{ print $13 }' >> ~/ruby/cpu-log
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
// 入力
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String rs = "";
rs = br.readLine();
@Naba0123
Naba0123 / hatena-noindex.js
Last active August 26, 2022 08:17
noindex hatena blog
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function() {
<!-- NOINDEX -->
if (document.getElementsByTagName("body")[0].classList.contains("category-noindex")){
console.log('add noindex'); // noindex が追加されているかの確認用。不要なら消してください。
var head = document.getElementsByTagName("head")[0];
var meta = document.createElement("meta");
meta.setAttribute("name","robots");
meta.setAttribute("content","noindex");
head.appendChild(meta);