aboutsummaryrefslogtreecommitdiff
path: root/problems/rubyshousehunt
diff options
context:
space:
mode:
Diffstat (limited to 'problems/rubyshousehunt')
-rw-r--r--problems/rubyshousehunt/attachments/template.c26
-rw-r--r--problems/rubyshousehunt/attachments/template.cpp26
-rw-r--r--problems/rubyshousehunt/attachments/template.java23
-rw-r--r--problems/rubyshousehunt/attachments/template.js15
-rw-r--r--problems/rubyshousehunt/attachments/template.py15
-rw-r--r--problems/rubyshousehunt/data/secret/1.ans6
-rw-r--r--problems/rubyshousehunt/data/secret/1.in8
-rw-r--r--problems/rubyshousehunt/data/secret/2.ans4
-rw-r--r--problems/rubyshousehunt/data/secret/2.in6
-rw-r--r--problems/rubyshousehunt/data/secret/3.ans4
-rw-r--r--problems/rubyshousehunt/data/secret/3.in6
-rw-r--r--problems/rubyshousehunt/data/secret/4.ans4
-rw-r--r--problems/rubyshousehunt/data/secret/4.in6
-rw-r--r--problems/rubyshousehunt/data/secret/5.ans5
-rw-r--r--problems/rubyshousehunt/data/secret/5.in7
-rw-r--r--problems/rubyshousehunt/data/secret/6.ans6
-rw-r--r--problems/rubyshousehunt/data/secret/6.in8
-rw-r--r--problems/rubyshousehunt/data/secret/7.ans6
-rw-r--r--problems/rubyshousehunt/data/secret/7.in8
-rw-r--r--problems/rubyshousehunt/data/secret/8.ans5
-rw-r--r--problems/rubyshousehunt/data/secret/8.in7
-rw-r--r--problems/rubyshousehunt/domjudge-problem.ini3
-rw-r--r--problems/rubyshousehunt/problem.pdfbin0 -> 29953 bytes
23 files changed, 204 insertions, 0 deletions
diff --git a/problems/rubyshousehunt/attachments/template.c b/problems/rubyshousehunt/attachments/template.c
new file mode 100644
index 0000000..ac44136
--- /dev/null
+++ b/problems/rubyshousehunt/attachments/template.c
@@ -0,0 +1,26 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+
+int main()
+{
+ int income;
+ float mr;
+ int savings;
+ scanf("%d%f%d", &income, &mr, &savings);
+ int N;
+ scanf("%d", &N);
+ for (int i = 0; i < N; i++) {
+ int price;
+ int expenses;
+ scanf("%d%d", &price, &expenses);
+ }
+
+ // Write an answer using printf(). DON'T FORGET THE TRAILING \n
+ // To debug: fprintf(stderr, "Debug messages...\n");
+
+ printf("Yes, the house is affordable with 1 roommate(s) and $1 to spare.\n");
+
+ return 0;
+}
diff --git a/problems/rubyshousehunt/attachments/template.cpp b/problems/rubyshousehunt/attachments/template.cpp
new file mode 100644
index 0000000..0f9ddf7
--- /dev/null
+++ b/problems/rubyshousehunt/attachments/template.cpp
@@ -0,0 +1,26 @@
+#include <iostream>
+#include <string>
+#include <vector>
+#include <algorithm>
+
+using namespace std;
+
+int main()
+{
+ int income;
+ float mr;
+ int savings;
+ cin >> income >> mr >> savings; cin.ignore();
+ int n;
+ cin >> n; cin.ignore();
+ for (int i = 0; i < n; i++) {
+ int price;
+ int expenses;
+ cin >> price >> expenses; cin.ignore();
+ }
+
+ // Write an answer using cout. DON'T FORGET THE "<< endl"
+ // To debug: cerr << "Debug messages..." << endl;
+
+ cout << "Yes, the house is affordable with 1 roommate(s) and $1 to spare." << endl;
+}
diff --git a/problems/rubyshousehunt/attachments/template.java b/problems/rubyshousehunt/attachments/template.java
new file mode 100644
index 0000000..ee06c60
--- /dev/null
+++ b/problems/rubyshousehunt/attachments/template.java
@@ -0,0 +1,23 @@
+import java.util.*;
+import java.io.*;
+import java.math.*;
+
+class Solution {
+
+ public static void main(String args[]) {
+ Scanner in = new Scanner(System.in);
+ int income = in.nextInt();
+ float mr = in.nextFloat();
+ int savings = in.nextInt();
+ int N = in.nextInt();
+ for (int i = 0; i < N; i++) {
+ int price = in.nextInt();
+ int expenses = in.nextInt();
+ }
+
+ // Write an answer using System.out.println()
+ // To debug: System.err.println("Debug messages...");
+
+ System.out.println("Yes, the house is affordable with 1 roommate(s) and $1 to spare.");
+ }
+}
diff --git a/problems/rubyshousehunt/attachments/template.js b/problems/rubyshousehunt/attachments/template.js
new file mode 100644
index 0000000..cb27e76
--- /dev/null
+++ b/problems/rubyshousehunt/attachments/template.js
@@ -0,0 +1,15 @@
+var inputs = readline().split(' ');
+const income = parseInt(inputs[0]);
+const mr = parseFloat(inputs[1]);
+const savings = parseInt(inputs[2]);
+const N = parseInt(readline());
+for (let i = 0; i < N; i++) {
+ var inputs = readline().split(' ');
+ const price = parseInt(inputs[0]);
+ const expenses = parseInt(inputs[1]);
+}
+
+// Write an answer using console.log()
+// To debug: console.error('Debug messages...');
+
+console.log('Yes, the house is affordable with 1 roommate(s) and $1 to spare.');
diff --git a/problems/rubyshousehunt/attachments/template.py b/problems/rubyshousehunt/attachments/template.py
new file mode 100644
index 0000000..3fa952c
--- /dev/null
+++ b/problems/rubyshousehunt/attachments/template.py
@@ -0,0 +1,15 @@
+import sys
+import math
+
+inputs = input().split()
+income = int(inputs[0])
+mr = float(inputs[1])
+savings = int(inputs[2])
+n = int(input())
+for i in range(n):
+ price, expenses = [int(j) for j in input().split()]
+
+# Write an answer using print
+# To debug: print("Debug messages...", file=sys.stderr, flush=True)
+
+print("Yes, the house is affordable with 1 roommate(s) and $1 to spare.")
diff --git a/problems/rubyshousehunt/data/secret/1.ans b/problems/rubyshousehunt/data/secret/1.ans
new file mode 100644
index 0000000..b5df307
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/1.ans
@@ -0,0 +1,6 @@
+Yes, the house is affordable with $1237 to spare.
+Yes, the house is affordable with $1287 to spare.
+No, the house is not affordable.
+No, the house is not affordable.
+No, the house is not affordable.
+No, the house is not affordable.
diff --git a/problems/rubyshousehunt/data/secret/1.in b/problems/rubyshousehunt/data/secret/1.in
new file mode 100644
index 0000000..4c3bb80
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/1.in
@@ -0,0 +1,8 @@
+2000 0.075 10000
+6
+100000 200
+100000 150
+100000 1500
+100000 1500
+100000 1800
+150000 200
diff --git a/problems/rubyshousehunt/data/secret/2.ans b/problems/rubyshousehunt/data/secret/2.ans
new file mode 100644
index 0000000..d2a39db
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/2.ans
@@ -0,0 +1,4 @@
+Yes, the house is affordable with $5558 to spare.
+No, the house is not affordable.
+No, the house is not affordable.
+No, the house is not affordable.
diff --git a/problems/rubyshousehunt/data/secret/2.in b/problems/rubyshousehunt/data/secret/2.in
new file mode 100644
index 0000000..53f9b02
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/2.in
@@ -0,0 +1,6 @@
+10000 0.5 90000
+4
+100600 4000
+400000 200
+350450 50
+500500 200
diff --git a/problems/rubyshousehunt/data/secret/3.ans b/problems/rubyshousehunt/data/secret/3.ans
new file mode 100644
index 0000000..ee1db35
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/3.ans
@@ -0,0 +1,4 @@
+No, the house is not affordable.
+No, the house is not affordable.
+No, the house is not affordable.
+Yes, the house is affordable with $16700 to spare.
diff --git a/problems/rubyshousehunt/data/secret/3.in b/problems/rubyshousehunt/data/secret/3.in
new file mode 100644
index 0000000..8ed544d
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/3.in
@@ -0,0 +1,6 @@
+20000 0.4 95000
+4
+900600 40000
+900000 18000
+404005 19000
+152000 1400
diff --git a/problems/rubyshousehunt/data/secret/4.ans b/problems/rubyshousehunt/data/secret/4.ans
new file mode 100644
index 0000000..f9eec7b
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/4.ans
@@ -0,0 +1,4 @@
+Yes, the house is affordable with $7933 to spare.
+No, the house is not affordable.
+Yes, the house is affordable with $6117 to spare.
+No, the house is not affordable.
diff --git a/problems/rubyshousehunt/data/secret/4.in b/problems/rubyshousehunt/data/secret/4.in
new file mode 100644
index 0000000..be17ca6
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/4.in
@@ -0,0 +1,6 @@
+9000 0.085 20000
+4
+100000 500
+504005 10000
+160300 1889
+500300 10000
diff --git a/problems/rubyshousehunt/data/secret/5.ans b/problems/rubyshousehunt/data/secret/5.ans
new file mode 100644
index 0000000..a9cdb61
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/5.ans
@@ -0,0 +1,5 @@
+Yes, the house is affordable with $2000 to spare.
+Yes, the house is affordable with $1500 to spare.
+Yes, the house is affordable with $1000 to spare.
+Yes, the house is affordable with $0 to spare.
+No, the house is not affordable.
diff --git a/problems/rubyshousehunt/data/secret/5.in b/problems/rubyshousehunt/data/secret/5.in
new file mode 100644
index 0000000..4d4e1be
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/5.in
@@ -0,0 +1,7 @@
+2000 0.0 10000
+5
+0 0
+0 500
+0 1000
+0 2000
+0 2001
diff --git a/problems/rubyshousehunt/data/secret/6.ans b/problems/rubyshousehunt/data/secret/6.ans
new file mode 100644
index 0000000..051c396
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/6.ans
@@ -0,0 +1,6 @@
+Yes, the house is affordable with $490 to spare.
+Yes, the house is affordable with $0 to spare.
+No, the house is not affordable.
+Yes, the house is affordable with $400 to spare.
+Yes, the house is affordable with $500 to spare.
+No, the house is not affordable.
diff --git a/problems/rubyshousehunt/data/secret/6.in b/problems/rubyshousehunt/data/secret/6.in
new file mode 100644
index 0000000..1ccf094
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/6.in
@@ -0,0 +1,8 @@
+500 0.0 10000
+6
+0 10
+0 500
+0 2000
+0 100
+0 0
+0 900
diff --git a/problems/rubyshousehunt/data/secret/7.ans b/problems/rubyshousehunt/data/secret/7.ans
new file mode 100644
index 0000000..0b13d46
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/7.ans
@@ -0,0 +1,6 @@
+Yes, the house is affordable with $1800 to spare.
+Yes, the house is affordable with $1850 to spare.
+Yes, the house is affordable with $500 to spare.
+Yes, the house is affordable with $0 to spare.
+Yes, the house is affordable with $200 to spare.
+No, the house is not affordable.
diff --git a/problems/rubyshousehunt/data/secret/7.in b/problems/rubyshousehunt/data/secret/7.in
new file mode 100644
index 0000000..5f60466
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/7.in
@@ -0,0 +1,8 @@
+2000 0.095 1000000
+6
+5000 200
+600000 150
+156000 1500
+477000 2000
+90000 1800
+560000 2500
diff --git a/problems/rubyshousehunt/data/secret/8.ans b/problems/rubyshousehunt/data/secret/8.ans
new file mode 100644
index 0000000..dadc3ee
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/8.ans
@@ -0,0 +1,5 @@
+No, the house is not affordable.
+No, the house is not affordable.
+Yes, the house is affordable with $1800 to spare.
+Yes, the house is affordable with $950 to spare.
+Yes, the house is affordable with $0 to spare.
diff --git a/problems/rubyshousehunt/data/secret/8.in b/problems/rubyshousehunt/data/secret/8.in
new file mode 100644
index 0000000..5a18ac7
--- /dev/null
+++ b/problems/rubyshousehunt/data/secret/8.in
@@ -0,0 +1,7 @@
+2000 0.055 1000000
+5
+677000 2200
+80000 2400
+5500 200
+300000 1050
+156000 2000
diff --git a/problems/rubyshousehunt/domjudge-problem.ini b/problems/rubyshousehunt/domjudge-problem.ini
new file mode 100644
index 0000000..a2b1639
--- /dev/null
+++ b/problems/rubyshousehunt/domjudge-problem.ini
@@ -0,0 +1,3 @@
+name = "Ruby's House Hunt"
+timelimit = 3
+points = 2
diff --git a/problems/rubyshousehunt/problem.pdf b/problems/rubyshousehunt/problem.pdf
new file mode 100644
index 0000000..e4731cb
--- /dev/null
+++ b/problems/rubyshousehunt/problem.pdf
Binary files differ