Language: C++

Last login: Thu Mar  1 15:54:29 on console
YHnoMacbook-pro:~ derodontus$ ls
AnacondaProjects	Untitled.ipynb		Untitled6.ipynb
Applications		Untitled1.ipynb		Untitled7.ipynb
Desktop			Untitled10.ipynb	Untitled8.ipynb
Documents		Untitled11.ipynb	Untitled9.ipynb
Downloads		Untitled12.ipynb	VirtualBox VMs
Dropbox			Untitled13.ipynb	anaconda
Library			Untitled14.ipynb	cache.ga
Movies			Untitled2.ipynb		enthought
Music			Untitled3.ipynb		installer.sh
Pictures		Untitled4.ipynb		test.txt
Public			Untitled5.ipynb		xh.pdf
YHnoMacbook-pro:~ derodontus$ cd Desktop
YHnoMacbook-pro:Desktop derodontus$ ls
1.cpp				自炊
2.php				言語
VirtualBox.app			音楽
a.out				ウイルス対策
~$彼らが太る前.docxx		同期ファイル
画像				応用情報技術者
YHnoMacbook-pro:Desktop derodontus$ cd 言語
YHnoMacbook-pro:言語 derodontus$ ls
C		Excel		MEIKAIC1S	python		vim
C++		Java		R		swift
YHnoMacbook-pro:言語 derodontus$ cd C++
YHnoMacbook-pro:C++ derodontus$ ls
AOJ	contest	test
YHnoMacbook-pro:C++ derodontus$ cd contest test
YHnoMacbook-pro:contest derodontus$ cd beginner
YHnoMacbook-pro:beginner derodontus$ cd /Users/derodontus/Desktop/言語/C++/contest/beginner/089 
YHnoMacbook-pro:089 derodontus$ vim A.cpp
YHnoMacbook-pro:089 derodontus$ vim B.cpp
YHnoMacbook-pro:089 derodontus$ vim C.cpp
YHnoMacbook-pro:089 derodontus$ vim D.cpp
YHnoMacbook-pro:089 derodontus$ cd ..
YHnoMacbook-pro:beginner derodontus$ mkdir 088
YHnoMacbook-pro:beginner derodontus$ cd 088
YHnoMacbook-pro:088 derodontus$ vim A.cpp
YHnoMacbook-pro:088 derodontus$ vim B.cpp
YHnoMacbook-pro:088 derodontus$ vim C.cpp







YHnoMacbook-pro:088 derodontus$ vim D.cpp
YHnoMacbook-pro:088 derodontus$ cd..
-bash: cd..: command not found
YHnoMacbook-pro:088 derodontus$ cd ..
YHnoMacbook-pro:beginner derodontus$ mkdir 087
YHnoMacbook-pro:beginner derodontus$ cd 087
YHnoMacbook-pro:087 derodontus$ vim A.cpp
YHnoMacbook-pro:087 derodontus$ vim B.cpp
YHnoMacbook-pro:087 derodontus$ vim C.cpp
YHnoMacbook-pro:087 derodontus$ cd ../086
-bash: cd: ../086: No such file or directory
YHnoMacbook-pro:087 derodontus$ cd ..
YHnoMacbook-pro:beginner derodontus$ mkdir 086
YHnoMacbook-pro:beginner derodontus$ cd 086
YHnoMacbook-pro:086 derodontus$ vim A.cpp
YHnoMacbook-pro:086 derodontus$ vim B.cpp
YHnoMacbook-pro:086 derodontus$ vim C.cpp
YHnoMacbook-pro:086 derodontus$ cd ..
YHnoMacbook-pro:beginner derodontus$ mkdir 085
YHnoMacbook-pro:beginner derodontus$ cd 085
YHnoMacbook-pro:085 derodontus$ vim A.cpp
YHnoMacbook-pro:085 derodontus$ vim B.cpp
YHnoMacbook-pro:085 derodontus$ vim B1.cpp
YHnoMacbook-pro:085 derodontus$ vim C.cpp
YHnoMacbook-pro:085 derodontus$ cd ..
YHnoMacbook-pro:beginner derodontus$ cd ..
YHnoMacbook-pro:contest derodontus$ l
-bash: l: command not found
YHnoMacbook-pro:contest derodontus$ ls
2:10		beginner	regular		企業
JOI		grand		typical		非公式
YHnoMacbook-pro:contest derodontus$ cd regular
YHnoMacbook-pro:regular derodontus$ ls
YHnoMacbook-pro:regular derodontus$ mkdeir 091
-bash: mkdeir: command not found
YHnoMacbook-pro:regular derodontus$ mkdir 091
YHnoMacbook-pro:regular derodontus$ ls
091
YHnoMacbook-pro:regular derodontus$ cd ..
YHnoMacbook-pro:contest derodontus$ ls
2:10		beginner	regular		企業
JOI		grand		typical		非公式
YHnoMacbook-pro:contest derodontus$ cd beginner
YHnoMacbook-pro:beginner derodontus$ ls
085	086	087	088	089
YHnoMacbook-pro:beginner derodontus$ mkdir 090
YHnoMacbook-pro:beginner derodontus$ cd 090
YHnoMacbook-pro:090 derodontus$ vim A.cpp
YHnoMacbook-pro:090 derodontus$ vim B.cpp
YHnoMacbook-pro:090 derodontus$ vim C.cpp
YHnoMacbook-pro:090 derodontus$ vim A.cpp
YHnoMacbook-pro:090 derodontus$ vim B.cpp
YHnoMacbook-pro:090 derodontus$ vim D.cpp
YHnoMacbook-pro:090 derodontus$ vim D.cpp
YHnoMacbook-pro:090 derodontus$ vim D.cpp
YHnoMacbook-pro:090 derodontus$ vim C.cpp
YHnoMacbook-pro:090 derodontus$ vim C1.cpp
YHnoMacbook-pro:090 derodontus$ vim D1.cpp
YHnoMacbook-pro:090 derodontus$ pwd
/Users/derodontus/Desktop/言語/C++/contest/beginner/090
YHnoMacbook-pro:090 derodontus$ cd ..
YHnoMacbook-pro:beginner derodontus$ ls
085	086	087	088	089	090
YHnoMacbook-pro:beginner derodontus$ mkdir 084
YHnoMacbook-pro:beginner derodontus$ cd 088
YHnoMacbook-pro:088 derodontus$ ls
A.cpp	B.cpp	C.cpp	a.out
YHnoMacbook-pro:088 derodontus$ vim D.cpp
YHnoMacbook-pro:088 derodontus$ cd ...
-bash: cd: ...: No such file or directory
YHnoMacbook-pro:088 derodontus$ cd ..
YHnoMacbook-pro:beginner derodontus$ ls
084	085	086	087	088	089	090
YHnoMacbook-pro:beginner derodontus$ pwd
/Users/derodontus/Desktop/言語/C++/contest/beginner
YHnoMacbook-pro:beginner derodontus$ cd ..
YHnoMacbook-pro:contest derodontus$ ls
2:10		beginner	regular		企業
JOI		grand		typical		非公式
YHnoMacbook-pro:contest derodontus$ cd ..
YHnoMacbook-pro:C++ derodontus$ ls
AOJ	contest	test
YHnoMacbook-pro:C++ derodontus$ cd AOJ
YHnoMacbook-pro:AOJ derodontus$ ls
1-4a.cpp	a[i][j]		itp1-5.cpp	itp1-8a.cpp
59.c		b[j][k]		itp1-5a.cpp	itp1-8b.cpp
59.cpp		itp1-2.cpp	itp1-5b.cpp	itp1-8c.cpp
63.cpp		itp1-2b.cpp	itp1-5d.cpp	itp1-8d.cpp
69.cpp		itp1-2c.cpp	itp1-6a.cpp	itp1-9a.cpp
72-1.cpp	itp1-2d.cpp	itp1-6b.cpp	itr1-1.cpp
72.cpp		itp1-3.cpp	itp1-6c.cpp	l
73.cpp		itp1-3b.cpp	itp1-6ctest.cpp	m
86		itp1-3c.cpp	itp1-6d.cpp	n
86-1.cpp	itp1-3d.cpp	itp1-7a.cpp	test-1.cpp
86.cpp		itp1-4b.cpp	itp1-7b.cpp	test.cpp
a.out		itp1-4c.cpp	itp1-7c.cpp	test59-1.c
a[i]		itp1-4d.cpp	itp1-7d.cpp	test63-1.cpp
YHnoMacbook-pro:AOJ derodontus$ ls
86		a[i][j]		itr1-1.cpp	test-1.cpp
86-1.cpp	alds1		l		test.cpp
a.out		b[j][k]		m		test59-1.c
a[i]		itp		n		test63-1.cpp
YHnoMacbook-pro:AOJ derodontus$ cd alds1
YHnoMacbook-pro:alds1 derodontus$ vim 1-3a.cpp
YHnoMacbook-pro:alds1 derodontus$ vim 1-3b.cpp

#include<iostream>                                               
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<string>
#include<vector>

#define LEN 100005
using namespace std;

typedef struct pp{
    char name[100];
    int t;
}P;

P Q[LEN];
int head,tail,n;

void enqueue(P x){
    Q[tail]=x;
    tail=(tail+1)%LEN;
}

P dequeue(){
    P x=Q[head];
    head=(head+1)%LEN;
    return x;
}

int main(){
    int elaps=0,c;
    int i,q;
    P u;
    scanf("%d %d",&n,&q);

    for(i=1;i<n;i++){
        scanf("%s",Q[i].name);
        scanf("%d",&Q[i].t);

    }
    head=1;              
    tail=n+1;

    while(head!=tail){
        u=dequeue();
        c=min(q,u.t);
        u.t-=c;
        elaps+=c;
        if(u.t>0)
            enqueue(u);
        else
            printf("%s %d\n",u.name,elaps);
    }



Compiler output:
a.cc:31:93: error: invalid digit "9" in octal constant
   31 | YHnoMacbook-pro:beginner derodontus$ cd /Users/derodontus/Desktop/言語/C++/contest/beginner/089
      |                                                                                             ^~~
a.cc:32:17: error: invalid digit "9" in octal constant
   32 | YHnoMacbook-pro:089 derodontus$ vim A.cpp
      |                 ^~~
a.cc:33:17: error: invalid digit "9" in octal constant
   33 | YHnoMacbook-pro:089 derodontus$ vim B.cpp
      |                 ^~~
a.cc:34:17: error: invalid digit "9" in octal constant
   34 | YHnoMacbook-pro:089 derodontus$ vim C.cpp
      |                 ^~~
a.cc:35:17: error: invalid digit "9" in octal constant
   35 | YHnoMacbook-pro:089 derodontus$ vim D.cpp
      |                 ^~~
a.cc:36:17: error: invalid digit "9" in octal constant
   36 | YHnoMacbook-pro:089 derodontus$ cd ..
      |                 ^~~
a.cc:37:44: error: invalid digit "8" in octal constant
   37 | YHnoMacbook-pro:beginner derodontus$ mkdir 088
      |                                            ^~~
a.cc:38:41: error: invalid digit "8" in octal constant
   38 | YHnoMacbook-pro:beginner derodontus$ cd 088
      |                                         ^~~
a.cc:39:17: error: invalid digit "8" in octal constant
   39 | YHnoMacbook-pro:088 derodontus$ vim A.cpp
      |                 ^~~
a.cc:40:17: error: invalid digit "8" in octal constant
   40 | YHnoMacbook-pro:088 derodontus$ vim B.cpp
      |                 ^~~
a.cc:41:17: error: invalid digit "8" in octal constant
   41 | YHnoMacbook-pro:088 derodontus$ vim C.cpp
      |                 ^~~
a.cc:49:17: error: invalid digit "8" in octal constant
   49 | YHnoMacbook-pro:088 derodontus$ vim D.cpp
      |                 ^~~
a.cc:50:17: error: invalid digit "8" in octal constant
   50 | YHnoMacbook-pro:088 derodontus$ cd..
      |                 ^~~
a.cc:52:17: error: invalid digit "8" in octal constant
   52 | YHnoMacbook-pro:088 derodontus$ cd ..
      |                 ^~~
a.cc:53:44: error: invalid digit "8" in octal constant
   53 | YHnoMacbook-pro:beginner derodontus$ mkdir 087
      |                                            ^~~
a.cc:54:41: error: invalid digit "8" in octal constant
   54 | YHnoMacbook-pro:beginner derodontus$ cd 087
      |                                         ^~~
a.cc:55:17: error: invalid digit "8" in octal constant
   55 | YHnoMacbook-pro:087 derodontus$ vim A.cpp
      |                 ^~~
a.cc:56:17: error: invalid digit "8" in octal constant
   56 | YHnoMacbook-pro:087 derodontus$ vim B.cpp
      |                 ^~~
a.cc:57:17: error: invalid digit "8" in octal constant
   57 | YHnoMacbook-pro:087 derodontus$ vim C.cpp
      |                 ^~~
a.cc:58:17: error: invalid digit "8" in octal constant
   58 | YHnoMacbook-pro:087 derodontus$ cd ../086
      |                 ^~~
a.cc:58:39: error: invalid digit "8" in octal constant
   58 | YHnoMacbook-pro:087 derodontus$ cd ../086
      |                                       ^~~
a.cc:59:15: error: invalid digit "8" in octal constant
   59 | -bash: cd: ../086: No such file or directory
      |               ^~~
a.cc:60:17: error: invalid digit "8" in octal constant
   60 | YHnoMacbook-pro:087 derodontus$ cd ..
      |                 ^~~
a.cc:61:44: error: invalid digit "8" in octal constant
   61 | YHnoMacbook-pro:beginner derodontus$ mkdir 086
      |                                            ^~~
a.cc:62:41: error: invalid digit "8" in octal constant
   62 | YHnoMacbook-pro:beginner derodontus$ cd 086
      |                                         ^~~
a.cc:63:17: error: invalid digit "8" in octal constant
   63 | YHnoMacbook-pro:086 derodontus$ vim A.cpp
      |                 ^~~
a.cc:64:17: error: invalid digit "8" in octal constant
   64 | YHnoMacbook-pro:086 derodontus$ vim B.cpp
      |                 ^~~
a.cc:65:17: error: invalid digit "8" in octal constant
   65 | YHnoMacbook-pro:086 derodontus$ vim C.cpp
      |                 ^~~
a.cc:66:17: error: invalid digit "8" in octal constant
   66 | YHnoMacbook-pro:086 derodontus$ cd ..
      |                 ^~~
a.cc:67:44: error: invalid digit "8" in octal constant
   67 | YHnoMacbook-pro:beginner derodontus$ mkdir 085
      |                                            ^~~
a.cc:68:41: error: invalid digit "8" in octal constant
   68 | YHnoMacbook-pro:beginner derodontus$ cd 085
      |                                         ^~~
a.cc:69:17: error: invalid digit "8" in octal constant
   69 | YHnoMacbook-pro:085 derodontus$ vim A.cpp
      |                 ^~~
a.cc:70:17: error: invalid digit "8" in octal constant
   70 | YHnoMacbook-pro:085 derodontus$ vim B.cpp
      |                 ^~~
a.cc:71:17: error: invalid digit "8" in octal constant
   71 | YHnoMacbook-pro:085 derodontus$ vim B1.cpp
      |                 ^~~
a.cc:72:17: error: invalid digit "8" in octal constant
   72 | YHnoMacbook-pro:085 derodontus$ vim C.cpp
      |                 ^~~
a.cc:73:17: error: invalid digit "8" in octal constant
   73 | YHnoMacbook-pro:085 derodontus$ cd ..
      |                 ^~~
a.cc:82:44: error: invalid digit "9" in octal constant
   82 | YHnoMacbook-pro:regular derodontus$ mkdeir 091
      |                                            ^~~
a.cc:84:43: error: invalid digit "9" in octal constant
   84 | YHnoMacbook-pro:regular derodontus$ mkdir 091
      |                                           ^~~
a.cc:86:1: error: invalid digit "9" in octal constant
   86 | 091
      | ^~~
a.cc:93:1: error: invalid digit "8" in octal constant
   93 | 085     086     087     088     089
      | ^~~
a.cc:93:9: error: invalid digit "8" in octal constant
   93 | 085     086     087     088     089
      |         ^~~
a.cc:93:17: error: invalid digit "8" in octal constant
   93 | 085     086     087     088     089
      |                 ^~~
a.cc:93:25: error: invalid digit "8" in octal constant
   93 | 085     086     087     088     089
      |                         ^~~
a.cc:93:33: error: invalid digit "9" in octal constant
   93 | 085     086     087     088     089
      |                                 ^~~
a.cc:94:44: error: invalid digit "9" in octal constant
   94 | YHnoMacbook-pro:beginner derodontus$ mkdir 090
      |                                            ^~~
a.cc:95:41: error: invalid digit "9" in octal constant
   95 | YHnoMacbook-pro:beginner derodontus$ cd 090
      |                                         ^~~
a.cc:96:17: error: invalid digit "9" in octal constant
   96 | YHnoMacbook-pro:090 derodontus$ vim A.cpp
      |                 ^~~
a.cc:97:17: error: invalid digit "9" in octal constant
   97 | YHnoMacbook-pro:090 derodontus$ vim B.cpp
      |                 ^~~
a.cc:98:17: error: invalid digit "9" in octal constant
   98 | YHnoMacbook-pro:090 derodontus$ vim C.cpp
      |                 ^~~
a.cc:99:17: error: invalid digit "9" in octal constant
   99 | YHnoMacbook-pro:090 derodontus$ vim A.cpp
      |                 ^~~
a.cc:100:17: error: invalid digit "9" in octal constant
  100 | YHnoMacbook-pro:090 derodontus$ vim B.cpp
      |                 ^~~
a.cc:101:17: error: invalid digit "9" in octal constant
  101 | YHnoMacbook-pro:090 derodontus$ vim D.cpp
      |                 ^~~
a.cc:102:17: error: invalid digit "9" in octal constant
  102 | YHnoMacbook-pro:090 derodontus$ vim D.cpp
      |                 ^~~
a.cc:103:17: error: invalid digit "9" in octal constant
  103 | YHnoMacbook-pro:090 derodontus$ vim D.cpp
      |                 ^~~
a.cc:104:17: error: invalid digit "9" in octal constant
  104 | YHnoMacbook-pro:090 derodontus$ vim C.cpp
      |                 ^~~
a.cc:105:17: error: invalid digit "9" in octal constant
  105 | YHnoMacbook-pro:090 derodontus$ vim C1.cpp
      |                 ^~~
a.cc:106:17: error: invalid digit "9" in octal constant
  106 | YHnoMacbook-pro:090 derodontus$ vim D1.cpp
      |                 ^~~
a.cc:107:17: error: invalid digit "9" in octal constant
  107 | YHnoMacbook-pro:090 derodontus$ pwd
      |                 ^~~
a.cc:108:53: error: invalid digit "9" in octal constant
  108 | /Users/derodontus/Desktop/言語/C++/contest/beginner/090
      |                                                     ^~~
a.cc:109:17: error: invalid digit "9" in octal constant
  109 | YHnoMacbook-pro:090 derodontus$ cd ..
      |                 ^~~
a.cc:111:1: error: invalid digit "8" in octal constant
  111 | 085     086     087     088     089     090
      | ^~~
a.cc:111:9: error: invalid digit "8" in octal constant
  111 | 085     086     087     088     089     090
      |         ^~~
a.cc:111:17: error: invalid digit "8" in octal constant
  111 | 085     086     087     088     089     090
      |                 ^~~
a.cc:111:25: error: invalid digit "8" in octal constant
  111 | 085     086     087     088     089     090
      |                         ^~~
a.cc:111:33: error: invalid digit "9" in octal constant
  111 | 085     086     087     088     089     090
      |                                 ^~~
a.cc:111:41: error: invalid digit "9" in octal constant
  111 | 085     086     087     088     089     090
      |                                         ^~~
a.cc:112:44: error: invalid digit "8" in octal constant
  112 | YHnoMacbook-pro:beginner derodontus$ mkdir 084
      |                                            ^~~
a.cc:113:41: error: invalid digit "8" in octal constant
  113 | YHnoMacbook-pro:beginner derodontus$ cd 088
      |                                         ^~~
a.cc:114:17: error: invalid digit "8" in octal constant
  114 | YHnoMacbook-pro:088 derodontus$ ls
      |                 ^~~
a.cc:116:17: error: invalid digit "8" in octal constant
  116 | YHnoMacbook-pro:088 derodontus$ vim D.cpp
      |                 ^~~
a.cc:117:17: error: invalid digit "8" in octal constant
  117 | YHnoMacbook-pro:088 derodontus$ cd ...
      |                 ^~~
a.cc:119:17: error: invalid digit "8" in octal constant
  119 | YHnoMacbook-pro:088 derodontus$ cd ..
      |                 ^~~
a.cc:121:1: error: invalid digit "8" in octal constant
  121 | 084     085     086     087     088     089     090
      | ^~