This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('data', function (chunk) { | |
var lines = chunk.toString().split('\n')[0].toString().trim().split(' '); | |
var result = (function(diff) { | |
var table = [0,1,2,3,2,1,2,3,3,2]; | |
return ~~(diff / 10) + table[diff % 10]; | |
}(Math.abs(lines[1] - lines[0]))); | |
console.log(result); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('data', function (chunk) { | |
var answers = {'1':0,'2':0,'3':0,'4':0}; | |
var lines = chunk.toString().split('\n'); | |
var len = parseInt(lines.shift(),10); | |
lines.toString().trim().split('').slice(0,len) | |
.forEach(function(v){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>タイトル</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css"> | |
<div class = "container"> | |
<form class="form-inline" role="form"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<title>Simple Map</title> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="utf-8"> | |
<style> | |
html, body, #map-canvas { | |
height: 100%; | |
margin: 0px; | |
padding: 0px | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl | |
use strict; | |
use warnings; | |
my ($length,@lines) = (<STDIN>,<STDIN>); | |
print(&total_price(@lines[0..$length -1])); | |
sub total_price { | |
my $total_price = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl | |
use strict; | |
use warnings; | |
my ($length,@stocks) = (<STDIN>,<STDIN>); | |
print(&sum(@stocks[0..$length -1])); | |
sub sum { | |
my $sum = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl | |
#2014/12/09 尺取り虫とか累積和とかよーわからんのじゃー | |
#2014/12/13 累積和 version by Omas | |
use strict; | |
use warnings; | |
my @info = split(/ /,<STDIN>); | |
my @line = <STDIN>; | |
my @cum_sum = &cumsum(@line[0..$info[1] - 1]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<script src='https://code.jquery.com/jquery-2.1.1.min.js'></script> | |
<script> | |
$(function(){ | |
var uri = 'http://maps.google.com/maps/api/staticmap?'; | |
var query = { | |
zoom:14 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
enchant(); | |
var game,girl; | |
var gs = { | |
height:320 | |
,width:320 | |
,fps:30 | |
}; | |
var BackGround = Class.create(Sprite,{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enchant(); // enchantライブラリ呼び出し | |
var game,stage; // GameCore,SceneGroupオブジェクト | |
var gs = {fps:30}; // Gameのfps | |
gs.canvas = {height:320,width:320}; // Windowの高さ,幅 | |
// ================================================== | |
var Panel = enchant.Class.create(enchant.Label,{ | |
initialize:function(id){ | |
enchant.Label.call(this,id); | |
this.id = id; |