% triangle(N,T) :-
% TはN番目の三角数である.
triangle(N,T) :-
N>0, N1 is N-1, triangle(N1,T1), T is T1+N.
triangle(0,0).
(2)
% power(X,N,V) :-
% VはXのN乗である.
power(X,N,V) :-
N>0, N1 is N-1, power(X,N1,V1), V is V1*X.
power(_,0,1).
SRM | Easy | Normal | Hard |
295 | o | - | - |
296 | o | - | - |
297 | o | - | - |
298 | o | - | - |
350 | o | - | - |
386 | o | - | - |
447 | o | - | - |
451 | o | - | - |
462 | o | - | - |
463 | o | - | - |
464 | o | - | - |
465 | o | - | - |
466 | o | - | - |
469 | o | - | - |
471 | o | - | - |
472 | o | - | - |
473 | o | - | - |
474 | o | - | - |
475 | o | - | - |
476 | o | - | - |
477 | o | - | - |
478 | o | - | - |
479 | o | - | - |
480 | o | - | - |
481 | o | - | - |
482 | o | o | - |
483 | o | - | - |
484 | o | - | - |
485 | o | - | - |
486 | o | - | - |
487 | o | - | - |
503 | - | o | - |
511 | - | o | - |
1 | hello world | 30B |
2 | echo | 31B |
3 | 99 shinichiroes of hamaji | 258B |
4 | example com | 451B |
5 | Smileys Triangle | 63B |
8 | delete blank lines | 37B |
14 | ultimate problem | 19B |
16 | even lines | 40B |
19 | Fibonacci Numbers | 46B |
34 | FizzBuzz | 84B |
48 | 67B |
0 件のコメント:
コメントを投稿