Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl6
- sub checkIt() {
- my $problems = $*IN.get().Int;
- my $cakewalk = 0;
- my $simple = 0;
- my $easy = 0;
- my $easy-medium-medium = 0;
- my $medium-hard-hard = 0;
- loop (my $i = 0; $i < $problems; $i++) {
- given $*IN.get() {
- when 'cakewalk' {$cakewalk++}
- when 'simple' {$simple++}
- when 'easy' {$easy++}
- when 'easy-medium' {$easy-medium-medium++}
- when 'medium' {$easy-medium-medium++}
- when 'medium-hard' {$medium-hard-hard++}
- when 'hard' {$medium-hard-hard++}
- }
- }
- if $cakewalk == 1 &&
- $simple == 1 &&
- $easy == 1 &&
- $easy-medium-medium == 1 &&
- $medium-hard-hard == 1 {return "Yes"}
- else {return "No"}
- }
- sub MAIN(*@args) {
- my $tests = $*IN.get().Int;
- my @results;
- loop (my $i = 0; $i < $tests; $i++) {
- @results.push(checkIt())
- }
- for @results {say $_}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement