Debugging

This commit is contained in:
Anthony Wang 2020-05-30 22:15:11 +00:00 committed by repl.it user
parent 37bd33cce1
commit 7aa23b3623
14 changed files with 125 additions and 67 deletions

View file

@ -1,2 +1,2 @@
language = "cpp"
run = "g++ src/*.cpp -o compress -std=c++1y; echo Compilation done; ./compress cowntact.txt 85"
run = "g++ src/*.cpp -o compress -std=c++1y; echo Compilation done; ./compress cowntact.txt 55"

BIN
A-70.out Normal file

Binary file not shown.

5
B-70.out Normal file
View file

@ -0,0 +1,5 @@
cw-tpprs.bss runs quick cow.wvng trees,dckng under brnchs.looks bhnd.thy'r gttng clsr.heart pndng,sweat drppng down neck,bss knows needs fast.barn.too far away.sh'll never reach t--h crs.old cllr down river.bss veers left,gllps cllr.nsd,sh'll safe.rchs door.blast,door lckd.pnckd,bss ntcs red bttn side.knwng,taps bttn dsprt hoof,hpng.sddnly,rcrdng voice booms rnd frst.open door,must solve fllwng prblm,fj n cows took cntst,rslts.cow thr grnsy hlstn.since hlstns gnrlly xprncd cntsts,fj fgrs prbbly bttr cntst.wants fgr whthr true.spcfclly,strng lngth n.chrctr g h.chrctr ndcts breed rnk-n cow,forth.fgr nmbr pairs cows,one grnsy,one hlstn,grnsy tprfrmd hlstn.ipf ipt strng lngth n,1<=n<=100.chrctr thr g h.opf sngl ntgr,nmbr pairs
Original length: 1245
Compressed length: 373
Percent compression: 70.0402%
jy³W×ùÓÕ°c×_ª>«Ïu{ûá¦7ytµëòîžW}ºUóãã¿ÿæ÷±BÀ ygh÷üœVeÝüßñf7¹0çÅÆú&k·MXb¹ß ÿõ³ìÛFuåNUÌt}æ(‡mâ½3/7„°Éí¿ë<C2BF>¬Gyg}ÿ{Þ9ÛYäWCæØQÿ[äpþæʸþ@ä<>Ù cæÜ]<5D><>ÝŒŸš™nÿ]CÍN yçìœ8ÓQ83Æ^׈|¹˜ÜÏí IùUlÿÃÄzaYoQÞyϘͲj}jCßwS¬<œeÕº]@¹ÿ/bƵ¶¤D0Ú&g¿ÊÓòÿÌÛ,p5~˜ëö?bF{åû”<C3BB>Dï&HÊDñÌkþï¹þ×Í[WGuƒÿëêpžâNW;N]žîtµç´ Rü|Àr3o]]Ï,ÎRbYóÖÕxó­³HðÛ«ÃíX0¯°É´©ºwpœÜwpÁÛ¸Îs6cõ

5
C-70.out Normal file
View file

@ -0,0 +1,5 @@
vrybdy cloud cmptng days,quite few dffrnt bsnss mdls being xprmntd.tryng smpl one,sell mchns one two btchs clld slots.cstmr buy one scnd cpu q scnds ntgr q.each slot cstmr prchss must cmpltd sngl mchn,dcd llct prchsd slots btwn mchns.after cmng back long vctn,see mchns idle,vrty rdrs come.keep cstmrs happy,must dcd dstrbt rqsts btwn mchns way mnmzs prchsd slots fnlly cmpltd.smllst mnt cmplt prchsd slots.ipf ipt cnssts sngl line cntnng four ntgrs q,2<=q<=1000,ndd cmplt lngr btchs,m,1<=m<=1000000,nmbr mchns owned cmpny,s,0<=s<=1000000,nmbr 1-scnd slots prchsd,l,0<=l<=1000000,nmbr q -scnd slots prchsd.opf dsply smllst mnt cmplt prchsd slots.spi 2 4 3 6 spo 4
Original length: 1144
Compressed length: 343
Percent compression: 70.0175%
ªj{Óz¶msóî5zV·»\5~ý­^/ÛÕóf÷»Ïç«Ç»Þ°ú~¸T××⮟ ¸þóý…¹×_Щôö»¾ðûÕ/6<>uöAðfíQJ£oÚÃúé<C3BA>ù”õùº~zK†ÅÌF<C38C>RsÉV·§iaö's%>Tt÷¼ü¹dSä_œ×ÞSäײ¼»7Ϻ<C38F>&sµPÑݹ<C39D>¤ÑKµ cõ§ôl<>?³¨<C2B3>H2WÚS<C39A>Jñ]°Ø]Pz{ºÁ5sé •XŒ<58>¥ÖÿÆ0à¿û¯ŽÏÅØY¨èj¨{Ž<>é¥Ú<C2A5>¿¯ºOí¾UÚS<C39A>J­ÓõGIµséOæJÓÌ_бú¼ÈL5ÊZбڹ<C39A>ô's%¾ÀõO-R*MéÙ¬Ÿl•é t¯»,ïjoÌ ÁoîµÖpþ¿ c5Kïî©@„{LÜk­µÖpÒsG<73>Rs<52>dA'},

5
C.out
View file

@ -2,4 +2,7 @@ vrybdy cloud cmptng days.tryng smpl one,sell mchns one two btchs clld slots.cstm
Original length: 1144
Compressed length: 171
Percent compression: 85.0524%
艕z=𩖞踠y嬉脂錴冲>从踠y<垳摫鼶>从g喧魼蒸案k5鐝而濊z豬o7奥羰y毆鵁需霠{稷狸幽盦端n煨癉需n愴-𠂆碫鼶震脂錴z稷狸幽艕冲撿濷{豬o煨m6奥羰y毆o煨薧{豬鵁;𨦸志濊冲撿o愴俳k琢-𦷰殣y<E6AEA3>
<EFBFBD>z=<3D>y<EFBFBD>^<5E>}><3E>y<<0F>|><3E>g<EFBFBD>v<EFBFBD>]<5D>k5<6B>M<EFBFBD>z<EFBFBD>o7<6F>y<EFBFBD>w<EFBFBD>{<7B>^<5E>W<EFBFBD>u<EFBFBD>n<EFBFBD>v<EFBFBD>n<EFBFBD>[-<16>|<7C>_<EFBFBD>z<EFBFBD>^<5E>W<EFBFBD>}<7D>{<7B>o<EFBFBD>m6<6D>y<EFBFBD>o<EFBFBD>{<7B>w;<3B>N<EFBFBD>}<7D>o<EFBFBD>[<5B>k<EFBFBD>Z-<2D>y<EFBFBD>
Everybody could computing days. Trying sample one, sell machines one or two batches collide slots. Customer buy one second cpu q seconds integer q. Input consists single line containing four integers q, 2<=q<=100, ndd complete longer batches, m, 1<=m<=1000000, machines owned, s, 0<=s<=1000000, 1-second slots purchased, l, 0<=l<=1000000, q -second slots purchased

0
D-70.out Normal file
View file

6
E-70.out Normal file
View file

@ -0,0 +1,6 @@
c++ dvsn pstv ntgrs lwys rnds down.smtms two ntgrs dvdd same dvsr bcm equal thgh rgnlly equal.5/4,7/4 both equal 1,5!=7.given list nnngtv ntgrs,dvsr.ipf line ipt cntns two ntgrs n,1<=n<=200000,nmbr lmnts list,d,1<=d<=10^9,dvsr.scnd line ipt cntns n ntgrs _1,...,_n,0<=_<=10^9,where a_i i th lmnt list.opf dsply sngl ntgr ndctng nmbr dstnct pairs ndcs (i,j) 1<=<j<=n such _/d=_j/d using ntgr dvsn c++.note nmbrs list ncssrly dstnct,i.e.pssbl _=_j ndcs i!=j
Original length: 887
Compressed length: 266
Percent compression: 70.0113%
ªú¾úòäÝU×·øp÷vU£<EFBFBD>=îó¬ªjÙÞ_5móùªQ§uíÛß郪†;Ýì¶ß®zÕ¹ãó?·‡Cq{vøÜÊt÷»€ð÷¿(Ô¿çþM@,ÓÝ/nˆ}y‡Åío%» òjÎèu\+\x,ÈKGC|t0¤˜Fá± ¯š>*REk77È®ùY.·2Ý}<7D>Û_=‡Ð®IØ9d-“ßÄ2ÝýÒ§â©ÆqGÏ]º];ó»æ§Gož
OeŽ<EFBFBD>G·¿ú-±kvYËä—eºû<C2BA>M¯µö1ýxªøTæ^X9ž<39>M£kgvÍO-¡ÅV¸O·Êt·Dtå.Ýâ'mv<6D>çýí7Â

0
F-70.out Normal file
View file

1
G-70.out Normal file
View file

@ -0,0 +1 @@
blgy lab ucf rcntly hvng prblms trnsmttng gntc sqncs btwn cmptrs.nfrtntly,crrnt systm rprsnts gntc sqncs strng chrctrs,'a','c','g','t'.order speed data trnsfrs tskd cmprssng data.lckly,prfssr dvsd easy,gave task ctlly mplmntng.cnsdr each lttrs nmbr bs-4,'a' = 0,'c' = 1,'g' = 2,'t' = 3,gntc sqnc nq bs-10 rprsnttn.needs mplmnt prgrm cnvrt strng dscrbng gntc sqnc bs-10 nmbr,vc-vrs,given bs-10 nmbr,opt crrspndng gntc sqnc.prblm,given gntc sqnc,opt crrspndng bs-10 nmbr.lkws,given nmbr bs-10,opt crrspndng gntc sqnc.ipf line ipt cntn pstv ntgr,q,rprsntng nmbr sqncs cnvrt.next q lines cntn thr ntgr,n,1<=n<=2^{30}-1,rprsnts bs-10 nmbr,grntd ldng zrs,gntc sqnc,rprsntd strng chrctrs 'a','c','g' nd/r 't',grntd ldng,btwn 1,15 chrctrs lngth.opf each sqnc,opt hdr sqnc #j,j rprsnts sqnc being prcssd,bgnnng 1.fllwng hdr,opt thr crrspndng gntc sqnc ntgr given,crrspndng bs-10 nmbr gntc sqnc.opt each sqnc each own opt line

6
G.out
View file

@ -2,4 +2,8 @@ blgy lab ucf rcntly hvng prblms trnsmttng gntc sqncs cmptrs.nfrtntly,crrnt rprsn
Original length: 1592
Compressed length: 238
Percent compression: 85.0503%
<EFBFBD>z=槃銛yシ^ッWォユj5孝」ム頡僘>欅ァモ騁コ]ョWォユ<EFBDAB>z=秀」ム鑼コ]ョラ<EFBDAE><EFBE97>~ソ゚oキ[ュヨkオレm6嶇誑ケ\ョラ<EFBDAE>:<0E><EFBFBD><E7A2A3><EFBFBD>ソ゚<EFBDBF>礼>症胝xシ^ッWォUェユ黏コ].陵蚌ケワⅸ{ス^ッラ<EFBDAF>z=<0F>aーXャヨ<EFBDAC>:斟銛<E6969F><E98A9B>ソ゚oキロ煜<EFBE9B><E7859C>?渮銛yジ<EFBDBC>サン荢サ]ョラk5 <>PィTェUェユjオレ咩サ]ョWォユ黏:蕊cアXャヨkオZュVォユ<EFBDAB><EFBE95><EFBFBD>ソ゚<EFBDBF>
<EFBFBD>z=<3D>y<EFBFBD>^<5E>W<EFBFBD>j5<1A>F<EFBFBD>}><3E>O<EFBFBD>t<EFBFBD>]<5D>W<EFBFBD>z=<1E>G<EFBFBD>t<EFBFBD>]<5D>~<7E>o<EFBFBD>[<5B>k<EFBFBD>m6<6D>s<EFBFBD>\<5C>u:<0E><EFBFBD>}><1F>x<EFBFBD>^<5E>W<EFBFBD>U<EFBFBD>u<EFBFBD>].<2E>r<EFBFBD>{<7B>^<5E>z=<0F>a<EFBFBD>X<EFBFBD>u:<3A><EFBFBD>o<EFBFBD>?<3F>y<EFBFBD>w<EFBFBD>w<EFBFBD>]<5D>k5 <06>A<EFBFBD>P<EFBFBD>T<EFBFBD>U<EFBFBD>j<EFBFBD>v<EFBFBD>]<5D>W<EFBFBD>u:<1D>c<EFBFBD>X<EFBFBD>k<EFBFBD>Z<EFBFBD>V<EFBFBD><EFBFBD>
Biology lab recently having problems transmitting genetic sequences to computers. Unfortunately, currently represents genetic sequences string characters gcat. luckily, professor easy gave task to implementing
given Q sequences whether in GCAT or base 10, output base 10 or GCAT

0
H-70.out Normal file
View file

View file

@ -1,62 +1,95 @@
Farmer John is worried for the health of his cows (conveniently numbered
$1 ... N$ as always) after an outbreak of the highly contagious bovine
disease COWVID-19.
Recently, Farmer John tested all of his cows and found some of them to be
positive for the disease. Using video footage from inside his barn, he is able
to review recent interactions between pairs of cows --- it turns out that when
cows greet each-other, they shake hooves, a gesture that can unfortunately
spread the infection from one cow to another. Farmer John assembles a
time-stamped list of interacting pairs of cows, with entries of the form
$(t, x, y)$, meaning that at time $t$, cow $x$ shook hooves with cow $y$.
Farmer John also knows the following:
(i) Exactly one cow on his farm could have started out carrying the disease
(we'll call this cow "patient zero").
(ii) Once a cow is infected, she passes the infection along with her next $K$
hoof shakes (possibly including the same partner cow several times). After
shaking hooves $K$ times, she no longer passes the infection along with
subsequent hoof shakes (since at this point she realizes she is spreading the
infection and washes her hooves carefully).
(iii) Once a cow is infected, she stays infected.
Unfortunately, Farmer John doesn't know which of his $N$ cows is patient zero,
nor does he know the value of $K$! Please help him narrow down the
possibilities for these unknowns based on his data. It is guaranteed that at
least one possibility is valid.
INPUT FORMAT
The first line of the input file contains $N$ ($2 <= N <= 100$) and $T$
($1 <= T <= 250$). The next line contains a string of length $N$ whose
entries are 0s and 1s, describing the current state of Farmer John's $N$ cows
--- 0 represents a healthy cow and 1 represents a cow presently with the
disease. Each of the next $T$ lines describes a record in Farmer John's list of
interactions and consists of three integers $t$, $x$, and $y$, where $t$ is a
positive integer time of the interaction ($t <= 250$) and $x$ and $y$ are
distinct integers in the range $1 \ldots N$, indicating which cows shook hands
at time $t$. At most one interaction happens at each point in time.
OUTPUT FORMAT
Print a single line with three integers $x$, $y$, and $z$, where $x$ is the
number of possible cows who could have been patient zero, $y$ is the smallest
possible value of $K$ consistent with the data, and $z$ is the largest possible
value of $K$ consistent with the data (if there is no upper bound on $K$ that
can be deduced from the data, print "Infinity" for $z$). Note that it might be
possible to have $K=0$.
SAMPLE INPUT
4 3
1100
7 1 2
5 2 3
6 2 4
SAMPLE OUTPUT
1 1 Infinity
The only candidate for patient zero is cow 1. For all $K>0$, cow 1 infects cow 2
at time 7, while cows 3 and 4 remain uninfected.
Farmer John is planning to build N (1≤N≤105) farms that will be connected by N1 roads, forming a tree. Typically, whenever one of his farms is having an issue he is not told the specific farm that is having an issue. Instead, he is told that one of the farms along the path from some farm A to another farm B is having an issue. This is often confusing for Farmer John, as he usually drives offroad tractors and isn't familiar with the road system.
Farmer John considers the location of a farm to be a 2D point. He would prefer to be told that there is a problem in one of the farms in a specified axis-aligned rectangular box. This way Farmer John can decide for himself how to navigate between the farms. Bessie told him that this is a little too ambitious, so he will be satisfied if he is notified with at most two axis-aligned rectangular boxes whose intersection (of farms) is empty and whose union is exactly the farms along the path from A to B. You must help Farmer John determine where he should build his farms such that this condition is satisfied.
This is an interactive problem, you will not be using standard (or file) I/O. Solutions that use standard (or file) I/O will be disqualified. However, you ARE ALLOWED to use global and static variables. You must implement the following functions to help Farmer John:
void addRoad(int A, int B): processes a road between farms A and B (0≤A,B≤N1).
void buildFarms(): determines where Farmer John should build all his farms.
void notifyFJ(int A, int B): notifies Farmer John with either one or two boxes that satisfy the aforementioned conditions.
Your implementation of the above functions will be able to call the functions given below. You may assume that notifyFJ will be called Q times (1≤Q≤105).
int getN(): gets the value of N.
int getQ(): gets the value of Q.
void setFarmLocation(int ID, int X, int Y): determines that Farmer John should build farm ID (0≤ID≤N1) at location (X,Y) where (1≤X,Y≤N). Should only be called from buildFarms.
void addBox(int X1, int Y1, int X2, int Y2): adds a box to notify Farmer John where (1≤X1≤X2≤N) and (1≤Y1≤Y2≤N). Should only be called from notifyFJ.
The interactive protocol works as follows. First, addRoad will be called N1 times, to inform your program of the road system. Then, buildFarms will be called and you must determine where Farmer John should build each farm and call setFarmLocation for every farm accordingly. Finally, there will be Q calls to notifyFJ where you must make either one or two calls to addBox to notify Farmer John.
It is guaranteed there is always a valid way to notify Farmer John using either one or two boxes. The memory limit for this problem is set to 512MB, above the usual 256MB limit.
For a C++ solution, use this template:
#include "grader.h"
void addRoad(int a, int b){
// Fill in code here
}
void buildFarms(){
// Fill in code here
}
void notifyFJ(int a, int b){
// Fill in code here
}
For a Java solution, use this template:
import java.io.IOException;
// If you find it necessary, you may import other standard libraries here.
public class boxes extends Grader {
// Copy this exactly:
@Override
public static void main(String args[]) throws IOException { new boxes().run(); }
@Override
public void addRoad(int a, int b) {
// Fill in code here
}
@Override
public void buildFarms(){
// Fill in code here
}
@Override
public void notifyFJ(int a, int b){
// Fill in code here
}
}
Sample Interaction
Grader calls addRoad(0,1)
Grader calls addRoad(1,2)
Grader calls buildFarms()
Solution calls setFarmLocation(0,1,1)
Solution calls setFarmLocation(1,1,2)
Solution calls setFarmLocation(2,2,2)
Solution ends buildFarms()
Grader calls notifyFJ(0,0)
Solution calls addBox(1,1,1,1)
Solution ends notifyFJ(0,0)
Grader calls notifyFJ(0,2)
Solution calls addBox(1,1,1,2)
Solution calls addBox(2,2,2,2)
Solution ends notifyFJ(0,2)
Grader terminates, and solution passes test-case
(Note: if you do not pass the first test case, the grader will indicate this as usual. However, note that the short sample interaction above does not correspond to the first test case or any other).
Problem credits: Spencer Compton

View file

@ -2,7 +2,7 @@
#include "huffman.h"
/*int main() {
ifstream enc("êõz=Çãñx¼Þïw»]®W«Õj5F£Ñèôz=žO'“Éär¹\\®×k5šÍf³Y¬V«Õj5†Ãa°X¬ÖkµZ­V«UªUªUªÕjµÚív»Ýî÷ûý~?");
ifstream enc("A.out");
stringstream ss;
ss << enc.rdbuf();
string s = ss.str();

View file

@ -71,6 +71,7 @@ weightstruct getweight(string s)
}
void preprocessword(int stage,string& s,string& next,int pos)
{
if(s.length()<2)return;
if(stage==-1)//after deleting low weights
{
if(s[0]=='$')
@ -473,4 +474,4 @@ int main(int argc, char *argv[]) {
cout << "Compressed length: " << (enc.size() + 7) / 8 << '\n';
cout << "Percent compression: " << 100.0 - (double)100.0 * (enc.size() + 7) / 8 / orig.size() << "%\n";
}*/
}
}