^[[ALast login: Sun May 29 16:41:22 on ttys000
jumpei-no-MacBook-Air:~ jumpeiokawara$ ssh s1230067@sshgate.u-aizu.ac.jp
PAM Authentication
Password: 
Last login: Wed Jun 01 2016 08:05:49 +0900 from p7215-ipngn1101
Oracle Corporation     SunOS 5.11      11.3    February 2016

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please log in to one of the hosts listed below.

- Solaris11: 
  - Computer Exercise Room 1 and 2  ... stdrsv1121 - stdrsv1125
  - Computer Exercise Room 3 and 4  ... std34rsv1 - std34rsv5
  - Hardware Workshop 1, 2, 3 and 4 ... stdrsv2121 - stdrsv2128
  - CALL Lab 1 and 2                ... stdrsv3121 - stdrsv3123
  - Faculty room                    ... prorsv1 - prorsv10
- OS X 10.9
  - Computer Exercise Room 5 and 6  ... std5dc2 - std5dc50, std6dc2 - std6dc50
  - iLab 1 and 2                    ... ilab1dc2 - ilab1dc49, ilab2dc2 - ilab2dc49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sshsv1{s1230067}51: 


sshsv1{s1230067}51: cd 2016_1
sshsv1{s1230067}52: cd Exercises
sshsv1{s1230067}53: cd Java
sshsv1{s1230067}54: ls -l
total 60
drwxr-xr-x 5 s1230067 student 4096  4??? 13 11:32 Ex1
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex10
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex11
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex12
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex13
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex14
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex15
drwxr-xr-x 2 s1230067 student 4096  4??? 20 12:14 Ex2
drwxr-xr-x 2 s1230067 student 4096  5??? 11 10:56 Ex3
drwxr-xr-x 2 s1230067 student 4096  5??? 11 12:44 Ex4
drwxr-xr-x 2 s1230067 student 4096  5??? 18 13:34 Ex5
drwxr-xr-x 2 s1230067 student 4096  5??? 25 13:13 Ex6
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex7
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex8
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex9
sshsv1{s1230067}55: cd Ex6
sshsv1{s1230067}56: ls
Circle.class         Rectangle.class    TestFigures.java
Confusing.class      Rhombus.class      TestFigures.java~
Confusing.java       Shape.class        TestFiguresEquals.class
Confusing.java~      Square.class       TestFiguresEquals.java
Parallelogram.class  TestFigures.class  TestFiguresEquals.java~
sshsv1{s1230067}57: cd ..
sshsv1{s1230067}58: cd Ex7
sshsv1{s1230067}59: ls
sshsv1{s1230067}60: Write failed: Broken pipe
jumpei-no-MacBook-Air:~ jumpeiokawara$ ssh s1230067@sshgate.u-aizu.ac.jp
PAM Authentication
Password: 
Last login: Thu Jun 09 2016 13:37:10 +0900 from p15134-ipngn110
Oracle Corporation     SunOS 5.11      11.3    February 2016

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please log in to one of the hosts listed below.

- Solaris11: 
  - Computer Exercise Room 1 and 2  ... stdrsv1121 - stdrsv1125
  - Computer Exercise Room 3 and 4  ... std34rsv1 - std34rsv5
  - Hardware Workshop 1, 2, 3 and 4 ... stdrsv2121 - stdrsv2128
  - CALL Lab 1 and 2                ... stdrsv3121 - stdrsv3123
  - Faculty room                    ... prorsv1 - prorsv10
- OS X 10.9
  - Computer Exercise Room 5 and 6  ... std5dc2 - std5dc50, std6dc2 - std6dc50
  - iLab 1 and 2                    ... ilab1dc2 - ilab1dc49, ilab2dc2 - ilab2dc49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sshsv1{s1230067}51: cd algo1
sshsv1{s1230067}52: cd le07
sshsv1{s1230067}53: ls
A.c  A.c~  AA.c  AA.c~  a.out  core
sshsv1{s1230067}54: rm AA.c
sshsv1{s1230067}55: more A.c
#include<stdio.h>
#define MAX 100005
#define NIL -1

struct Node
{ 
int x, y, z;
};
struct Node A1[MAX];

int num, G, A2[MAX];

int getDepth(int m){
  int b = 0;
  for(; A1[m].x != NIL ;b++) m = A1[m].x;
  return b;
}

void print(int m){
  int i, c;
  printf("node %d: ", m);
  printf("parent = %d, ", A1[m].x);
sshsv1{s1230067}56: 
sshsv1{s1230067}56: 
sshsv1{s1230067}56: 
sshsv1{s1230067}56: emacs A.c

File Edit Options Buffers Tools C Help                                          
#include<stdio.h>
#define MAX 100000
#define NIL -1

struct Node
{
int x, y, z;
};
struct Node A1[MAX];

int num, G, A2[MAX];

int getDepth(int m){
  int b = 0;
  for(; A1[m].x != NIL ;b++) m = A1[m].x;
  return b;
}

void print(int m){
  int i, c;
  printf("node %d: ", m);
  printf("parent = %d, ", A1[m].x);
  printf("depth = %d, ", A2[m]);

  if ( A1[m].x == NIL ) printf("root, ");
  else if ( A1[m].y == NIL ) printf("leaf, ");
  else printf("internal node, ");

  printf("[");
  for(i = 0, c = A1[m].y; c != NIL; i++, c = A1[c].z){
    if (i) printf(", ");
    printf("%d", c);
  }
  printf("]\n");
}

int main(){
  int i, j, a, b, c, y;
  scanf("%d", &num);
  for ( i = 0; i < num; i++ ) A1[i].x = A1[i].y = A1[i].z = NIL;

  for ( i = 0; i < num; i++ ){
    scanf("%d %d", &a, &b);
    for ( j = 0; j < b; j++ ){
      scanf("%d", &c);
      if ( j == 0 ) A1[a].y = c;
      else A1[y].z = c;
      y = c;
      A1[c].x = a;
    }
  }

  G = 0;
  for ( i = 0; i < num; i++ ){
    A2[i] = getDepth(i);
    if ( A2[i] > G ) G = A2[i];
  }

  for ( i = 0; i < num; i++ )
    {
      print(i);
    }

  return 0;
}