WC '17 Contest 3 J3 - Uncrackable

View as PDF

Submit solution


Points: 5
Time limit: 1.0s
Memory limit: 16M

Author:
Problem type
Woburn Challenge 2017-18 Round 3 - Junior Division

You'd like to register an account on an extremely entertaining website. You've already selected a username, but it seems that the requirements for choosing a password are quite strict, in order to completely protect your account from being hacked into. The password must be a string between 8 and 12 characters long (inclusive), such that every character is either a lowercase letter (az), uppercase letter (AZ), or digit (09). Furthermore, it must contain at least three lowercase letters, at least two uppercase letters, and at least one digit.

You've got a potential password in mind, a non-empty string made up of at most 100 characters, each of which is a lowercase letter, uppercase letter, or digit. Rather than entering the password into the site and risking rejection, you'd like to determine for yourself whether or not your password would validly satisfy all of the rules.

Input Specification

The first and only line of input consists of a single string, the password.

Output Specification

Output a single string, either Valid if the password is valid, or Invalid otherwise.

Sample Input 1

PassW0rd

Sample Output 1

Valid

Sample Input 2

CorrectHorseBatteryStaple

Sample Output 2

Invalid

Sample Explanations

In the first case, the password has 8 characters, with 5 lowercase letters, 2 uppercase letters, and 1 digit, meaning that all of the rules are satisfied.

In the second case, the password has two issues - it's more than 12 characters long, and it doesn't contain at least one digit.


Comments


  • 0
    lockhart3000  commented on Feb. 1, 2026, 3:36 a.m.

    The website in the example doesn't load. Does anyone have an alternate link?


    • 0
      do_ur_homwork  commented on Feb. 1, 2026, 7:46 p.m. edit 2

      Its not supposed to 💀

      Edit: Here behind the scenes

      Edit 2: link doesnt work so here:

      <!DOCTYPE html>
      <html lang="en-us">
      <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width">
      <title>Patience is a virtue | Welcome</title>
      <style>
          @import url(http://fonts.googleapis.com/css?family=Nobile:400,700);
      
          body {
              font-family: 'Nobile', sans-serif;
              color: #CCC;
              padding: 0 2em;
          }
      
          #main {
              margin: 15em auto 2em auto;
              text-align: center;
          }
      
          h1 {
              font-weight: 400;
              font-size: 22px;
          }
      
          #copy {
              position: fixed;
              bottom: 10px;
              right: 10px;
              text-align: right;
              padding: 1em;
              font-size: .65em;
          }
      
          #copy a {
                  color: #CCC;
          }
      
          @media (max-width: 700px) {
                  #main {
                      margin-top: 5em;
                  }
          }
      </style>
      <script>
      function init() {
          var h1 = document.getElementById('js'), delay = 120000;
      
          setTimeout(function() {
              h1.innerHTML = "This is taking a bit longer than planned. Stand by, please.";
      
              setTimeout(function() {
                  h1.innerHTML = "Thank you for your patience.";
      
                  setTimeout(function() {
                      h1.innerHTML = "It is much appreciated.";
      
                      setTimeout(function() {
                          h1.innerHTML = "Just a little longer.";
      
                          setTimeout(function() {
                              h1.innerHTML = "Eeerh...";
      
                              setTimeout(function() {
                                  h1.innerHTML = "So... how was your day so far ?";
      
                                  setTimeout(function() {
                                      h1.innerHTML = "We really apologize, this is seriously taking much longer than usual.";
      
                                      setTimeout(function() {
                                          h1.innerHTML = "You're still here ?";
      
                                          setTimeout(function() {
                                              h1.innerHTML = "You seriously have nothing better to do ?";
      
                                              setTimeout(function() {
                                                  h1.innerHTML = "Well, we admire your patience.";
      
                                                  setTimeout(function() {
                                                      h1.innerHTML = "No, really.";
      
                                                      setTimeout(function() {
                                                          h1.innerHTML = "As they say, 'Patience is a virtue'.";
      
                                                          setTimeout(function() {
                                                              h1.innerHTML = "You know that you've been staring at this page for " + Math.round(((13 * delay) / 1000) / 60) + " minutes, right ?";
      
                                                              setTimeout(function() {
                                                                  h1.innerHTML = "That's not freaking you out ?";
      
                                                                  setTimeout(function() {
                                                                      h1.innerHTML = "No ? Well, in that case...";
      
                                                                      setTimeout(function() {
                                                                          window.location.href = 'http://24.media.tumblr.com/tumblr_m5jhpwrqmx1qii6tmo1_250.gif';
                                                                      }, delay);
                                                                  }, delay);
                                                              }, delay);
                                                          }, delay);
                                                      }, delay);
                                                  }, delay);
                                              }, delay);
                                          }, delay);
                                      }, delay);
                                  }, delay);
                              }, delay);
                          }, delay);
                      }, delay);
                  }, delay);
              }, delay);
          }, delay);
      }
      </script>
      
      <script type="text/javascript">
      
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-40644815-1']);
        _gaq.push(['_trackPageview']);
      
        (function() {
          var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
          ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
          var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
      
      </script>
      <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
      <script type="text/javascript">stLight.options({publisher: "31be64d5-a055-4986-9c8b-23b137031374", doNotHash: true, doNotCopy: true, hashAddressBar: false});</script>
      </head>
      
      <body onload="init()">
        <!--
          If you're seeing this, than you're a geek.
          And if you're a geek, than you might be interested to know what crazy mind made this.
          http://wadmiraal.net is the place to find out.
          Cheers, y'all.
        -->
      
        <div id="main">
          <h1 id="js">Loading, please wait</h1>
          <p><img src="loader.gif" /></p>
        </div>
      
        <div id="copy">
          <span class='st_facebook_hcount' displayText='Facebook'></span>
          <span class='st_twitter_hcount' displayText='Tweet'></span>
          <p>This site uses Google Analytics, which uses cookies. Deal with it.</p>
        </div>
      </body>
      </html>

  • 0
    tacos  commented on Dec. 16, 2025, 1:06 a.m.

    try this testcase: ChiminiN0


  • 0
    tychonm12  commented on Nov. 4, 2025, 11:43 p.m.

    Make sure you re-read the conditions