This file contains 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
#include <stdio.h> | |
typedef struct{ | |
float x; | |
float y; | |
}point; | |
typedef struct{ | |
point ul; | |
point lr; | |
}rect; |
This file contains 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
puts "Hello World!" | |
10.times do |i| | |
puts i+1 | |
end | |
names = ["ruby", "is", "awesome"] | |
for name in names | |
puts name | |
end |
This file contains 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
一隻神奇聰明貓走進了一間亂七八糟的房間,他不想自己動手收拾,他決定要找幫手來工作。於是他從他的帽子中變出了N隻小貓來幫他(變出來的貓,高度為原來貓的 1/(N+1) )。這些小貓也有帽子,所以每一隻小貓又從他的帽子中變出N隻小小貓來幫他。如此一直下去,直到這些小小小....貓小到不能再小(高度=1),他們的帽子無法再變出更小的貓來幫忙,而這些最小的貓只得動手打掃房間。注意:所有貓的高度都是正整數。 | |
在這個問題中,給你一開始那隻貓的高度,以及最後動手工作的貓的數目(也就是高度為1的貓的數目)。要請你求出有多少隻貓是沒有在工作的,以及所有貓的高度的總和。 | |
Input | |
每組測試資料一列,有2個正整數分別代表一開始那隻貓的高度,以及最後動手工作的貓的數目。0 0代表輸入結束。 | |
Output | |
每組測試資料輸出一列,包含2個正整數分別代表有多少隻貓是沒有在工作的,以及所有貓的高度的總和。 |
This file contains 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
import org.opencv.core.Core; | |
import org.opencv.core.Mat; | |
import org.opencv.core.MatOfRect; | |
import org.opencv.core.Point; | |
import org.opencv.core.Rect; | |
import org.opencv.core.Scalar; | |
import org.opencv.highgui.Highgui; | |
import org.opencv.highgui.VideoCapture; | |
import org.opencv.objdetect.CascadeClassifier; |
This file contains 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
#include <allegro5/allegro.h> | |
#include <allegro5/allegro_primitives.h> | |
#include <allegro5/allegro_ttf.h> | |
#include <allegro5/allegro_font.h> | |
#include <stdio.h> | |
struct bar{ | |
int y; | |
}bar1, bar2; |
This file contains 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
if((a.x+a.w >= b.x) || (b.x+b.w >= a.x)){ | |
if((a.y+a.h >= b.y) || (b.y+b.h >= a.y)){ | |
// do some thing | |
} | |
} |
This file contains 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
import javax.jms.Connection; | |
import javax.jms.ConnectionFactory; | |
import javax.jms.Destination; | |
import javax.jms.JMSException; | |
import javax.jms.MessageProducer; | |
import javax.jms.Session; | |
import javax.jms.TextMessage; | |
import javax.naming.NamingException; | |
import org.apache.activemq.ActiveMQConnectionFactory; |
This file contains 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
package algroithmhw1; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.Scanner; | |
/** | |
* | |
* @author Takeshi | |
*/ |
This file contains 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
#include <allegro5/allegro.h> | |
#include <allegro5/allegro_primitives.h> | |
#include <allegro5/allegro_ttf.h> | |
#include <allegro5/allegro_font.h> | |
#include <allegro5/allegro_audio.h> | |
#include <allegro5/allegro_acodec.h> | |
#include <allegro5/allegro_image.h> |
This file contains 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
F( n ) = [ 0 (if n < min[w1, w2] ) | |
min[F(n-w1) + c1, F(n-w2) + c2] | |
] |