conversations
listlengths
2
2
Question Name
stringclasses
49 values
Question Description
stringclasses
49 values
Input Requirements
stringclasses
49 values
Output Requirements
stringclasses
49 values
Sample Input
stringclasses
49 values
Sample Output
stringclasses
49 values
Difficulty
stringclasses
1 value
Question Source
stringclasses
1 value
Question Source URL
stringclasses
1 value
Answer Source
stringclasses
1 value
Answer Source URL
stringclasses
1 value
Exam name
stringclasses
1 value
Exam Description
stringclasses
1 value
CPE Website
stringclasses
1 value
[ { "content": "Do you know the solution for 10783 Odd Sum.", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Show me the code for 10783 Odd Sum with explanations.", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Generate a code solution for 10783 Odd Sum.", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "I need a C++ code for 10783 Odd Sum, generate it for me.", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "「10783 Odd Sum」要怎麼解? ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "「10783 Odd Sum」的解答是什麼?", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "如何用C++實作「10783 Odd Sum」? ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "給我一個「10783 Odd Sum」的C++程式碼。 ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "你知道「10783 Odd Sum」的解法嗎? ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "撰寫「10783 Odd Sum」的程式碼並附帶說明。 ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "生成「10783 Odd Sum」的程式碼解答。 ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "我需要「10783 Odd Sum」的C++程式碼,幫我生成一個。 ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "10783 Odd Sum 要怎麼解? ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "10783 Odd Sum 的解答是什麼?", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "如何用C++實作 10783 Odd Sum? ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "給我一個 10783 Odd Sum 的C++程式碼。 ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "你知道 10783 Odd Sum 的解法嗎? ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "撰寫 10783 Odd Sum 的程式碼並附帶說明。 ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "生成 10783 Odd Sum 的程式碼解答。 ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n }\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "我需要 10783 Odd Sum 的C++程式碼,幫我生成一個。 ", "role": "user" }, { "content": "#include<iostream>\nusing namespace std;\n \nint main(){\n int T;\n cin >> T;\n for (int i = 1; i <= T; i++) {\n int a, b;\n cin >> a >> b;\n if (a % 2 == 0) {\n a += 1;\n ...
10783 Odd Sum
Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.
There can be at multiple test cases. The first line of input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.
For each test case you are to print one line of output – the serial number of the test case followed by the summation of the odd integers in the range [a, b].
2 1 5 3 5
Case 1: 9 Case 2: 8
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to solve \"10812 Beat the Spread!\"?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "What is the solution for \"10812 Beat the Spread!\"?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to implement \"10812 Beat the Spread!\" in C++?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Give me a C++ code for \"10812 Beat the Spread!\".", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Do you know the solution for \"10812 Beat the Spread!\".", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Show me the code for \"10812 Beat the Spread!\" with explanations.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"imposs...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Generate a code solution for \"10812 Beat the Spread!\".", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "I need a C++ code for \"10812 Beat the Spread!\", generate it for me.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"imp...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to solve 10812 Beat the Spread!?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "What is the solution for 10812 Beat the Spread!?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to implement 10812 Beat the Spread! in C++?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Give me a C++ code for 10812 Beat the Spread!.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Do you know the solution for 10812 Beat the Spread!.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Show me the code for 10812 Beat the Spread! with explanations.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Generate a code solution for 10812 Beat the Spread!.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "I need a C++ code for 10812 Beat the Spread!, generate it for me.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossi...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "「10812 Beat the Spread!」要怎麼解? ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "「10812 Beat the Spread!」的解答是什麼?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "如何用C++實作「10812 Beat the Spread!」? ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "給我一個「10812 Beat the Spread!」的C++程式碼。 ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "你知道「10812 Beat the Spread!」的解法嗎? ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "撰寫「10812 Beat the Spread!」的程式碼並附帶說明。 ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "生成「10812 Beat the Spread!」的程式碼解答。 ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "我需要「10812 Beat the Spread!」的C++程式碼,幫我生成一個。 ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n els...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "10812 Beat the Spread! 要怎麼解? ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "10812 Beat the Spread! 的解答是什麼?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "如何用C++實作 10812 Beat the Spread!? ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "給我一個 10812 Beat the Spread! 的C++程式碼。 ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "你知道 10812 Beat the Spread! 的解法嗎? ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "撰寫 10812 Beat the Spread! 的程式碼並附帶說明。 ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "生成 10812 Beat the Spread! 的程式碼解答。 ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n else {\n ...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "我需要 10812 Beat the Spread! 的C++程式碼,幫我生成一個。 ", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint main() {\n int T, s, d;\n cin >> T;\n while (T--){\n cin >> s >> d;\n if ((s + d) % 2 || s < d) cout << \"impossible\\n\";\n els...
10812 Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. Given the winning n...
The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.
For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.
2 40 20 20 40
30 10 impossible
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to solve \"10908 Largest Square\"?", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "What is the solution for \"10908 Largest Square\"?", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to implement \"10908 Largest Square\" in C++?", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Give me a C++ code for \"10908 Largest Square\".", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Do you know the solution for \"10908 Largest Square\".", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a))...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Show me the code for \"10908 Largest Square\" with explanations.", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Generate a code solution for \"10908 Largest Square\".", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a))...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "I need a C++ code for \"10908 Largest Square\", generate it for me.", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to solve 10908 Largest Square?", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "What is the solution for 10908 Largest Square?", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n c...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to implement 10908 Largest Square in C++?", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n ci...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Give me a C++ code for 10908 Largest Square.", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Do you know the solution for 10908 Largest Square.", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Show me the code for 10908 Largest Square with explanations.", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, size...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Generate a code solution for 10908 Largest Square.", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "I need a C++ code for 10908 Largest Square, generate it for me.", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, s...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "「10908 Largest Square」要怎麼解? ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n whil...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "「10908 Largest Square」的解答是什麼?", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n whi...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "如何用C++實作「10908 Largest Square」? ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "給我一個「10908 Largest Square」的C++程式碼。 ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "你知道「10908 Largest Square」的解法嗎? ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n w...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "撰寫「10908 Largest Square」的程式碼並附帶說明。 ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "生成「10908 Largest Square」的程式碼解答。 ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "我需要「10908 Largest Square」的C++程式碼,幫我生成一個。 ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >>...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "10908 Largest Square 要怎麼解? ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n while...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "10908 Largest Square 的解答是什麼?", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n whil...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "如何用C++實作 10908 Largest Square? ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n w...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "給我一個 10908 Largest Square 的C++程式碼。 ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "你知道 10908 Largest Square 的解法嗎? ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n w...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "撰寫 10908 Largest Square 的程式碼並附帶說明。 ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "生成 10908 Largest Square 的程式碼解答。 ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >> t;\n ...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "我需要 10908 Largest Square 的C++程式碼,幫我生成一個。 ", "role": "user" }, { "content": "#include <iostream>\n#include <cstring>\n#include <algorithm>\nusing namespace std;\n \nint t, m, n, q, a[105][105], mx[105][105], x, y, ans;\nchar c;\n \nint main() {\n memset(a, -1, sizeof(a));\n cin >>...
10908 Largest Square
Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and the center [intersecting point of the two diagonals] of the square is at location (r,c). The height and width of the grid is M and N respectively. Upper left cor...
The input starts with a line containing a single integer T (< 21). This is followed by T test cases. The first line of each of them will contain three integers M, N and Q (< 21) separated by a space where M, N denotes the dimension of the grid. Next follows M lines each containing N characters. Finally, there will be Q...
For each test case in the input produce Q + 1 lines of output. In the first line print the value of M, N and Q in that order separated by single space. In the next Q lines, output the length of a side of the largest square in the corresponding grid for each (r,c) pair in the input.
1 7 10 4 abbbaaaaaa abbbaaaaaa abbbaaaaaa aaaaaaaaaa aaaaaaaaaa aaccaaaaaa aaccaaaaaa 1 2 2 4 4 6 5 2
7 10 4 3 1 5 1
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to solve \"10922 2 the 9s\"?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n }\n count...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "What is the solution for \"10922 2 the 9s\"?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n ...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to implement \"10922 2 the 9s\" in C++?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n }...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Give me a C++ code for \"10922 2 the 9s\".", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n }\...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Do you know the solution for \"10922 2 the 9s\".", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Show me the code for \"10922 2 the 9s\" with explanations.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total ...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Generate a code solution for \"10922 2 the 9s\".", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "I need a C++ code for \"10922 2 the 9s\", generate it for me.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n tot...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to solve 10922 2 the 9s?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n }\n count++;\...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "What is the solution for 10922 2 the 9s?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n }\n ...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "How to implement 10922 2 the 9s in C++?", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n }\n ...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Give me a C++ code for 10922 2 the 9s.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n }\n ...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Do you know the solution for 10922 2 the 9s.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n ...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Show me the code for 10922 2 the 9s with explanations.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += t...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "Generate a code solution for 10922 2 the 9s.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total += temp;\n ...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null
[ { "content": "I need a C++ code for 10922 2 the 9s, generate it for me.", "role": "user" }, { "content": "#include <iostream>\nusing namespace std;\n \nint func(string s, int count){\n int temp = 0, total = 0;\n for (int i = 0; i < s.length(); i++){\n temp = s[i] - '0';\n total +...
10922 2 the 9s
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursion needed to obtain the answer on N is called the 9-degree of N. Your job is, given a positive number N, determine if i...
The input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digits.
The output of the program shall indicate, for each input number, if it is a multiple of nine, and in case it is, the value of its nine-degree. See the sample output for an example of the expected formatting of the output.
9999999999999999999999 9 999999999999999999999999999999998 0
9999999999999999999999 is a multiple of 9 and has 9-degree 3. 9 is a multiple of 9 and has 9-degree 1. 999999999999999999999999999998 is not a multiple of 9.
One star
Online Judge
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=0
Yui Huang's Website
https://yuihuang.com/cpe-level-1/
null
null
null