UCT | Tips

Our Scoring System

We want to be transparent with you when it comes to our scoring system. The system is designed to account for both correct answers and time taken to finish the contest. We find both to be equally important in judging a participants performance and coming up with a score. However, our system prioritizes number of correct solutions rather than the time taken. On top of that, 2 points will be subtracted for every attempt past the first 9 attempts (in total; inclusive of all questions).

$$\text{Score} = (50 \cdot \text{Correct Answers})(1-(0.01 \cdot \text{Minutes Elapsed})) - (2 \cdot (\text{Attempts - 9}))$$

So... you may need File I/O

Here's a very basic problem (that is very unreflective of our actual problems!) to demonstrate a starter template which may be useful.

    # One option for this problem would be to hardcode the values into a variable and print the output to your terminal.
    # After that, you could copy paste the output in your terminal to the contest page. 

    var = "Hello World" 

    print(len("Hello World")) 

    # However, sometimes the input or output may be very long and extremely bothersome to copy from the terminal and put into your main file, which is where file i/o comes in! 
    # Essentially, you would put the input in a file called (for example) `input.txt`. Then, you would read the contents of the file and put it into a variable and process that. Then, rather than outputting to the terminal, you will write it to a file called `output.txt` and copy paste the contents of that file into the contest page. 

    # First, create two files, input.txt and output.txt (and clear their contents after each problem). 

    f = open("input.txt", "r")
    var = f.read() 

    lengthOfString = len(var) 

    f = open("output.txt", "w")
    f.write(lengthOfString)
    f.close()

    # Now you can open output.txt and copy paste the content into our contest page! 

      

      // One option for this problem would be to hardcode the values into a variable and print the output to your terminal.
      // After that, you could copy paste the output in your terminal to the contest page. 
      
      #include <iostream>
      #include <string> 
      
      using namespace std;
      
      int main(){
          string var = "Hello, World!";
          cout << var.length(); 
      }
      
      // However, sometimes the input or output may be very long and extremely bothersome to copy from the terminal and put into your main file, which is where file i/o comes in! 
      // Essentially, you would put the input in a file called (for example) `input.txt`. Then, you would read the contents of the file and put it into a variable and process that. Then, rather than outputting to the terminal, you will write it to a file called `output.txt` and copy paste the contents of that file into the contest page. 
      
      // First, create two files, input.txt and output.txt (and clear their contents after each problem). 
      
      #include <iostream>
      #include <fstream> 
      
      using namespace std;
      
      int main(){
          string var;
      
          ifstream File("input.txt"); 
          
          getline (File, var); 
          
          File.close();
          
          
          ofstream File("output.txt");
      
          File << var.length();
          
          File.close();
      }
      
      // Now you can open output.txt and copy paste the content into our contest page!