Skip to content

Instantly share code, notes, and snippets.

View hanjae-jea's full-sized avatar

Hanjae hanjae-jea

View GitHub Profile
#include <stdio.h>
int max, mlen, cnt, b, check[10000000];
int ubak(long long int a) {
if (a<10000000 && check[a] != 0)
return cnt + check[a];
cnt++;
if (a == 1)
return cnt;
#include <stdio.h>
int n;
void f1(int n)
{
int ok = 1;
for (int i = 2; i<n; i++) {
if (n%i == 0)
ok--;
}
if (ok == 1)
class MyClass:
myVar = 1
def HelloWorld(self):
MyClass.myVar = 2
self.myVar = 3
a = MyClass()
print(MyClass.myVar)
print(a.myVar)
@hanjae-jea
hanjae-jea / 11404.cpp
Last active August 8, 2018 07:28
0808
#include <stdio.h>
int graph[105][105];
int main()
{
int n, m;
scanf("%d", &n);
scanf("%d", &m);
for (int i = 0; i < m; i++) {
@hanjae-jea
hanjae-jea / urls.py
Created July 30, 2018 07:38
nonmame
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^bookmark/', include('bookmark.urls', namespace='bookmark')),
url(r'^blog/', include('blog.urls', namespace='blog')),
]
#include<iostream>
#include<algorithm>
using namespace std;
struct point {int x, y;};
import serial #Serial imported for Serial communication
import time #Required to use delay functions
ArduinoSerial = serial.Serial('/dev/cu.usbmodem1421',9600) #Create Serial port object called arduinoSerialData
time.sleep(2) #wait for 2 secounds for the communication to get established
print (ArduinoSerial.readline()) #read the serial data and print it as line
print ("Enter 1 to turn ON LED and 0 to turn OFF LED")
#include <stdio.h>
char inp[100];
char st[100];
int top = 0;
void push(char c){
st[top++] = c;
}
char pop(){
if( top == 0 ) return -1;
return st[--top];
#include <stdio.h>
#include <stdlib.h>
typedef struct node{
char value;
struct node* parent;
struct node* left, *right;
}node;
typedef node* p_node;
void inorder(p_node node){
@hanjae-jea
hanjae-jea / ans.cpp
Created June 1, 2018 12:17
제한재 선생님 답변
/* // 1번
#include <stdio.h>
int arr[105][105] = {0,}; // 배열 크기는 넉넉하게 0으로 초기화
int main(void)
{
int n, m;
scanf("%d %d", &n, &m); // 입력