Cody

Problem 1887. Graceful Graph: Wichmann Rulers

Solution 1674179

Submitted on 15 Nov 2018 by Binbin Qi
• Size: 81
• This is the leading solution.
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
tic n=17; exp=101; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.010299 seconds.

2   Pass
n=19; exp=123; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.031285 seconds.

3   Pass
n=23; exp=183; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.047415 seconds.

4   Pass
n=29; exp=289; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.064350 seconds.

5   Pass
n=31; exp=327; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.083200 seconds.

6   Pass
n=37; exp=465; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.100520 seconds.

7   Pass
n=41; exp=573; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.120466 seconds.

8   Pass
n=43; exp=627; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.145089 seconds.

9   Pass
n=47; exp=751; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.164468 seconds.

10   Pass
n=53; exp=953; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.181004 seconds.

11   Pass
n=59; exp=1179; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.197320 seconds.

12   Pass
n=61; exp=1257; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.213538 seconds.

13   Pass
n=67; exp=1515; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.229963 seconds.

14   Pass
n=71; exp=1703; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.247576 seconds.

15   Pass
n=73; exp=1797; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.274355 seconds.

16   Pass
n=79; exp=2103; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.300322 seconds.

17   Pass
n=83; exp=2323; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.320440 seconds.

18   Pass
n=89; exp=2669; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.337231 seconds.

19   Pass
n=97; exp=3165; S=Graceful_Wichmann(n); assert(S(end)==exp) delta=abs(repmat(S,n,1)-repmat(S',1,n)); assert(length(unique(delta(:)))==S(end)+1) % zero increases delta unique toc

Elapsed time is 0.354118 seconds.