Cody

# Problem 1731. Text File Read: 64 bit data set

Solution 1677273

Submitted on 20 Nov 2018 by William
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
% This section has no assert to show the values being returned Q=4; fn='Cody_64.txt'; m=read_input64(Q,fn)

m = 4×2 uint64 matrix 308436464205151562 1850618785230909388 760961177192651897 1521922354385303795 23875933057623902 1098292920650700527 1000 2000000000000000000

2   Pass
Q=4; fn='Cody_64.txt'; m=read_input64(Q,fn) m_exp=[uint64(308436464205151562) uint64(1850618785230909388);uint64(760961177192651897) uint64(1521922354385303795);uint64(23875933057623902) uint64(1098292920650700527);1000 2000000000000000000]; assert(isequal(m,m_exp));

m = 4×2 uint64 matrix 308436464205151562 1850618785230909388 760961177192651897 1521922354385303795 23875933057623902 1098292920650700527 1000 2000000000000000000

3   Pass
Q=4; m_exp=randi(2^31,Q,2); fn='Cody_64a.txt'; fid=fopen(fn,'w'); for i=1:Q fprintf(fid,'%s %s\n',num2str(m_exp(i,1)),num2str(m_exp(i,2))); end fclose(fid); m=read_input64(Q,fn); assert(isequal(m,m_exp))

4   Pass
Q=8; m_exp=randi(2^31,Q,2)*2^19; fn='Cody_64.txt'; fid=fopen(fn,'w'); for i=1:Q fprintf(fid,'%s %s\n',num2str(m_exp(i,1)),num2str(m_exp(i,2))); end fclose(fid); m=read_input64(Q,fn); assert(isequal(m,m_exp))