buggy_code
stringlengths 11
625k
| fixed_code
stringlengths 17
625k
| bug_type
stringlengths 2
4.45k
| language
int64 0
8
| token_count
int64 5
200k
| change_count
int64 0
100
|
|---|---|---|---|---|---|
using System;
class main {
public static void Main() {
string[] s = Console.ReadLine().Split(' ');
int a = int.Parse(s[0]), b = int.Parse(s[1]), c = int.Parse(s[2]);
int count = 0;
for (int i = a; i < b; i++)
if (c % i == 0)
count += 1;
Console.WriteLine(count);
}
}
|
using System;
class main {
public static void Main() {
string[] s = Console.ReadLine().Split(' ');
int a = int.Parse(s[0]), b = int.Parse(s[1]), c = int.Parse(s[2]);
int count = 0;
for (int i = a; i <= b; i++)
if (c % i == 0)
count += 1;
Console.WriteLine(count);
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 108
| 2
|
using System;
using System.Collections.Generic;
class Program {
static void Main(string[] args) {
String[] aryStr = Console.ReadLine().Split(' ');
int a = int.Parse(aryStr[0]);
int b = int.Parse(aryStr[1]);
int c = int.Parse(aryStr[2]);
int count = 0;
for (int i = a; i < b; i++) {
if (c % i == 0) {
count++;
}
}
Console.WriteLine(count);
}
}
|
using System;
using System.Collections.Generic;
class Program {
static void Main(string[] args) {
String[] aryStr = Console.ReadLine().Split(' ');
int a = int.Parse(aryStr[0]);
int b = int.Parse(aryStr[1]);
int c = int.Parse(aryStr[2]);
int count = 0;
for (int i = a; i <= b; i++) {
if (c % i == 0) {
count++;
}
}
Console.WriteLine(count);
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 123
| 2
|
using System;
class Program {
static void Main(string[] args) {
Input CInput = new Input();
int[] input = new int[(int)Input.Define.MAX_ArraySize];
// int[,] input = new int[(int) Input.Define.MAX_ArraySize, (int)
// Input.Define.ArraySize2d]; int num = 0;
input = CInput.Line1_int(' ', 3);
// input = CInput.Multiline_int(' ' ,2, ref num);
int count = 0;
for (int i = input[0]; i < input[1]; i++) {
if (input[2] % i == 0)
count++;
}
Console.WriteLine("{0}", count);
}
class Input {
public enum Define {
MAX_ArraySize = 1000000,
ArraySize2d = 2, // 2?¬?????????????[][?] ???????
}
public string Line1_string() { return Console.ReadLine(); }
public int Line1_int() {
var input = Console.ReadLine();
return int.Parse(input);
}
public int[] Line1_int(int chr, int num) {
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int i = 0; i < num; i++) {
spliti[i] = int.Parse(split[i]);
}
return spliti;
}
public int[] Multiline_int(ref int datanum) {
int i = 0;
int[] data = new int[(int)Input.Define.MAX_ArraySize];
while (true) {
var input = Console.ReadLine();
var value = int.Parse(input);
if (value == 0)
break;
data[i] = value;
i++;
}
datanum = i;
return data;
}
/// <summary>
/// ?????°??????int??????????????????????????????
/// </summary>
/// <param name="chr">???????????????</param>
/// <param name="num">?????????????????????????????°</param>
/// <param name="datanum">??????????????????????????°</param>
/// <returns></returns>
public int[,] Multiline_int(int chr, int num, ref int datanum) {
int i = 0;
int[,] data = new int[(int)Input.Define.MAX_ArraySize,
(int)Input.Define.ArraySize2d];
while (true) {
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int j = 0; j < num; j++) {
spliti[j] = int.Parse(split[j]);
}
if (spliti[0] == 0 && spliti[1] == 0)
break;
data[i, 0] = spliti[0];
data[i, 1] = spliti[1];
i++;
}
datanum = i;
return data;
}
}
}
|
using System;
class Program {
static void Main(string[] args) {
Input CInput = new Input();
int[] input = new int[(int)Input.Define.MAX_ArraySize];
// int[,] input = new int[(int) Input.Define.MAX_ArraySize, (int)
// Input.Define.ArraySize2d]; int num = 0;
input = CInput.Line1_int(' ', 3);
// input = CInput.Multiline_int(' ' ,2, ref num);
int count = 0;
for (int i = input[0]; i <= input[1]; i++) {
if (input[2] % i == 0)
count++;
}
Console.WriteLine("{0}", count);
}
class Input {
public enum Define {
MAX_ArraySize = 1000000,
ArraySize2d = 2, // 2?¬?????????????[][?] ???????
}
public string Line1_string() { return Console.ReadLine(); }
public int Line1_int() {
var input = Console.ReadLine();
return int.Parse(input);
}
public int[] Line1_int(int chr, int num) {
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int i = 0; i < num; i++) {
spliti[i] = int.Parse(split[i]);
}
return spliti;
}
public int[] Multiline_int(ref int datanum) {
int i = 0;
int[] data = new int[(int)Input.Define.MAX_ArraySize];
while (true) {
var input = Console.ReadLine();
var value = int.Parse(input);
if (value == 0)
break;
data[i] = value;
i++;
}
datanum = i;
return data;
}
/// <summary>
/// ?????°??????int??????????????????????????????
/// </summary>
/// <param name="chr">???????????????</param>
/// <param name="num">?????????????????????????????°</param>
/// <param name="datanum">??????????????????????????°</param>
/// <returns></returns>
public int[,] Multiline_int(int chr, int num, ref int datanum) {
int i = 0;
int[,] data = new int[(int)Input.Define.MAX_ArraySize,
(int)Input.Define.ArraySize2d];
while (true) {
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int j = 0; j < num; j++) {
spliti[j] = int.Parse(split[j]);
}
if (spliti[0] == 0 && spliti[1] == 0)
break;
data[i, 0] = spliti[0];
data[i, 1] = spliti[1];
i++;
}
datanum = i;
return data;
}
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 513
| 2
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApp8 {
class Program {
public static void Main(string[] args) {
string[] input = Console.ReadLine().Split(' ');
int a = int.Parse(input[0]);
int b = int.Parse(input[1]);
int c = int.Parse(input[2]);
int f = 0;
for (int d = a; d < b; d++) {
int e = c % d;
if (e == 0)
f++;
}
Console.WriteLine(f);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApp8 {
class Program {
public static void Main(string[] args) {
string[] input = Console.ReadLine().Split(' ');
int a = int.Parse(input[0]);
int b = int.Parse(input[1]);
int c = int.Parse(input[2]);
int f = 0;
for (int d = a; d <= b; d++) {
int e = c % d;
if (e == 0)
f++;
}
Console.WriteLine(f);
}
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 141
| 2
|
using System;
namespace AOJ {
class Program {
static void Main(string[] args) {
{
var read = Console.ReadLine();
var temp_string = read.Split(' ');
int a = int.Parse(temp_string[0]), b = int.Parse(temp_string[1]),
c = int.Parse(temp_string[2]), ans = 0;
for (int i = a; i <= b; i++) {
if (i % c == 0) {
ans++;
}
}
Console.WriteLine(ans);
}
}
}
}
|
using System;
namespace AOJ {
class Program {
static void Main(string[] args) {
{
var read = Console.ReadLine();
var temp_string = read.Split(' ');
int a = int.Parse(temp_string[0]), b = int.Parse(temp_string[1]),
c = int.Parse(temp_string[2]), ans = 0;
for (int i = a; i <= b; i++) {
if (c % i == 0) {
ans++;
}
}
Console.WriteLine(ans);
}
}
}
}
|
[["-", 8, 196, 0, 57, 15, 16, 31, 16, 31, 22], ["-", 8, 196, 0, 57, 15, 16, 31, 16, 17, 109], ["+", 8, 196, 0, 57, 15, 16, 31, 16, 17, 109], ["+", 8, 196, 0, 57, 15, 16, 31, 16, 12, 22]]
| 8
| 122
| 4
|
using System;
class MainClass {
public static void Main(string[] args) {
string str = Console.ReadLine();
string[] spStr = str.Split(' ');
int a = int.Parse(spStr[0]);
int b = int.Parse(spStr[1]);
int c = int.Parse(spStr[2]);
int x = 0;
for (int i = a; i < b; i++) {
if (c % i == 0) {
x++;
}
}
Console.WriteLine(x);
}
}
|
using System;
class MainClass {
public static void Main(string[] args) {
string str = Console.ReadLine();
string[] spStr = str.Split(' ');
int a = int.Parse(spStr[0]);
int b = int.Parse(spStr[1]);
int c = int.Parse(spStr[2]);
int x = 0;
for (int i = a; i <= b; i++) {
if (c % i == 0) {
x++;
}
}
Console.WriteLine(x);
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 122
| 2
|
using System;
class ITP1_3_D {
public static void Main() {
string[] Input = Console.ReadLine().Split(' ');
int a = int.Parse(Input[0]);
int b = int.Parse(Input[1]);
int c = int.Parse(Input[2]);
int count = 0;
for (; a < b; a++) {
if (c % a == 0)
count++;
}
Console.WriteLine(count);
}
}
|
using System;
class ITP1_3_D {
public static void Main() {
string[] Input = Console.ReadLine().Split(' ');
int a = int.Parse(Input[0]);
int b = int.Parse(Input[1]);
int c = int.Parse(Input[2]);
int count = 0;
for (; a <= b; a++) {
if (c % a == 0)
count++;
}
Console.WriteLine(count);
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 107
| 2
|
using System;
namespace ConsoleApplication3 {
class Program {
static void Main(string[] args) {
int a, b, c, d;
string[] input = Console.ReadLine().Split(' ');
a = int.Parse(input[0]);
b = int.Parse(input[1]);
c = int.Parse(input[2]);
d = 0;
for (; a < b; a++) {
if (c % a == 0) {
d++;
}
}
Console.WriteLine(d);
}
}
}
|
using System;
namespace ConsoleApplication3 {
class Program {
static void Main(string[] args) {
int a, b, c, d;
string[] input = Console.ReadLine().Split(' ');
a = int.Parse(input[0]);
b = int.Parse(input[1]);
c = int.Parse(input[2]);
d = 0;
for (; a <= b; a++) {
if (c % a == 0) {
d++;
}
}
Console.WriteLine(d);
}
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 121
| 2
|
using System;
namespace Project {
class MainClass {
public static void Main(string[] args) {
string s = Console.ReadLine();
string[] sar = s.Split(' ');
int a, b, c;
a = int.Parse(sar[0]);
b = int.Parse(sar[1]);
c = int.Parse(sar[2]);
int number = 0;
for (int i = a; i <= b; i++) {
if (i % c == 0) {
number++;
}
}
Console.WriteLine(number);
}
}
}
|
using System;
namespace Project {
class MainClass {
public static void Main(string[] args) {
string s = Console.ReadLine();
string[] sar = s.Split(' ');
int a, b, c;
a = int.Parse(sar[0]);
b = int.Parse(sar[1]);
c = int.Parse(sar[2]);
int number = 0;
for (int i = a; i <= b; i++) {
if (c % i == 0) {
number++;
}
}
Console.WriteLine(number);
}
}
}
|
[["-", 8, 196, 0, 57, 15, 16, 31, 16, 31, 22], ["-", 8, 196, 0, 57, 15, 16, 31, 16, 17, 109], ["+", 8, 196, 0, 57, 15, 16, 31, 16, 17, 109], ["+", 8, 196, 0, 57, 15, 16, 31, 16, 12, 22]]
| 8
| 130
| 4
|
using System;
class A {
public static void Main() {
string[] input = Console.ReadLine().Split(' ');
int a = int.Parse(input[0]);
int b = int.Parse(input[1]);
int c = int.Parse(input[2]);
int count = 0;
for (int i = a; i < b; i++) {
if ((c % i) == 0) {
count++;
}
}
Console.WriteLine(count);
}
}
|
using System;
class A {
public static void Main() {
string[] input = Console.ReadLine().Split(' ');
int a = int.Parse(input[0]);
int b = int.Parse(input[1]);
int c = int.Parse(input[2]);
int count = 0;
for (int i = a; i <= b; i++) {
if ((c % i) == 0) {
count++;
}
}
Console.WriteLine(count);
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 115
| 2
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace StartFinish {
class Program {
static void Main(string[] args) {
int[] abc = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
int count = 0;
for (int i = abc[0]; i < abc[1]; i++) {
if (abc[2] % i == 0) {
count++;
}
}
Console.WriteLine(count);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace StartFinish {
class Program {
static void Main(string[] args) {
int[] abc = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
int count = 0;
for (int i = abc[0]; i <= abc[1]; i++) {
if (abc[2] % i == 0) {
count++;
}
}
Console.WriteLine(count);
}
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 123
| 2
|
// ITP1_3_D
using System;
using System.Collections.Generic;
/*using System.Linq;
using System.Text;
using System.Threading.Tasks;*/
class Program {
static void Main(string[] args) {
//?????????????????????????????????int??????iaaray????????????????????\
int[] iarray = Array.ConvertAll<string, int>(
(Console.ReadLine().Split(' ')),
delegate(string value) { return int.Parse(value); });
int count = 0;
for (int i = iarray[0]; i < iarray[1]; i++) {
if ((iarray[2] % i) == 0)
count++;
}
Console.WriteLine(count);
}
}
|
// ITP1_3_D
using System;
using System.Collections.Generic;
/*using System.Linq;
using System.Text;
using System.Threading.Tasks;*/
class Program {
static void Main(string[] args) {
//?????????????????????????????????int??????iaaray????????????????????\
int[] iarray = Array.ConvertAll<string, int>(
(Console.ReadLine().Split(' ')),
delegate(string value) { return int.Parse(value); });
int count = 0;
for (int i = iarray[0]; i <= iarray[1]; i++) {
if ((iarray[2] % i) == 0)
count++;
}
Console.WriteLine(count);
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 124
| 2
|
using System;
namespace Sample1 {
class Program {
static void Main(string[] args) {
string input = Console.ReadLine();
int a = int.Parse(input.Split(' ')[0]);
int b = int.Parse(input.Split(' ')[1]);
int c = int.Parse(input.Split(' ')[2]);
int answer = 0;
for (int i = a; i < b; i += 1) {
if (c % i == 0) {
answer += 1;
}
}
Console.WriteLine(answer);
}
}
}
|
using System;
namespace Sample1 {
class Program {
static void Main(string[] args) {
string input = Console.ReadLine();
int a = int.Parse(input.Split(' ')[0]);
int b = int.Parse(input.Split(' ')[1]);
int c = int.Parse(input.Split(' ')[2]);
int answer = 0;
for (int i = a; i <= b; i += 1) {
if (c % i == 0) {
answer += 1;
}
}
Console.WriteLine(answer);
}
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 134
| 2
|
using System;
using System.Linq;
public class Hello {
public static void Main() {
int[] num = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
int count = 0;
for (int i = num[0]; i < num[1]; i++) {
if (num[2] % i == 0) {
count++;
}
}
Console.WriteLine(count);
}
}
|
using System;
using System.Linq;
public class Hello {
public static void Main() {
int[] num = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
int count = 0;
for (int i = num[0]; i <= num[1]; i++) {
if (num[2] % i == 0) {
count++;
}
}
Console.WriteLine(count);
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 100
| 2
|
using System;
using System.Collections.Generic;
public class HowManyDivisors {
//????????????????????????
//a~b?????????c????´???°??????????????????????????????
static void Main(string[] args) {
/*---??£?¨???¨---*/
int i;
string[] unit_num;
int[] num = new int[3]; // a, b, c = num1, num2, num3
int count = 0;
/*---??£?¨???¨---*/
/*3?????????[a,b,c](a???b????????????c????´???°??????????????????)????????????????????§??????*/
unit_num = Console.ReadLine().Split(' ');
num[0] = int.Parse(unit_num[0]);
num[1] = int.Parse(unit_num[1]);
num[2] = int.Parse(unit_num[2]);
/*a~b????????§c????´???°?????°????????????*/
for (i = num[0]; i < num[1]; i++) {
if (num[2] % i == 0) {
count++;
}
}
Console.WriteLine(count);
}
}
|
using System;
using System.Collections.Generic;
public class HowManyDivisors {
//????????????????????????
//a~b?????????c????´???°??????????????????????????????
static void Main(string[] args) {
/*---??£?¨???¨---*/
int i;
string[] unit_num;
int[] num = new int[3]; // a, b, c = num[0], num[1], num[2]
int count = 0; //?´???°?????±?¨?
/*---??£?¨???¨---*/
/*3?????????[a,b,c](a???b????????????c????´???°??????????????????)????????????????????§??????*/
unit_num = Console.ReadLine().Split(' ');
num[0] = int.Parse(unit_num[0]);
num[1] = int.Parse(unit_num[1]);
num[2] = int.Parse(unit_num[2]);
/*a~b????????§c????´???°?????°????????????*/
for (i = num[0]; i <= num[1]; i++) {
if (num[2] % i == 0) {
count++;
}
}
Console.WriteLine(count);
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 161
| 2
|
using System;
using System.CodeDom;
using System.Linq;
using System.Text;
namespace paizaTest {
internal class Program {
private static void Main(string[] args) {
var oneLine = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
var count = 0;
for (int i = oneLine[0]; i < oneLine[1]; i++) {
count = oneLine[2] % i == 0 ? ++count : count;
}
Console.WriteLine(count.ToString());
}
}
}
|
using System;
using System.CodeDom;
using System.Linq;
using System.Text;
namespace paizaTest {
internal class Program {
private static void Main(string[] args) {
var oneLine = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
var count = 0;
for (int i = oneLine[0]; i <= oneLine[1]; i++) {
count = oneLine[2] % i == 0 ? ++count : count;
}
Console.WriteLine(count.ToString());
}
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 120
| 2
|
using System;
namespace AizuOnlineJudge {
class Program {
static void Main(string[] args) {
var nums = Converter(Console.ReadLine());
Console.WriteLine(Calc(nums));
}
static int[] Converter(string str) {
return Array.ConvertAll(str.Split(' '), int.Parse);
}
static int Calc(int[] array) {
int count = 0;
for (int i = array[0]; i < array[1]; i++)
if (array[2] % i == 0)
count++;
return count;
}
}
}
|
using System;
namespace AizuOnlineJudge {
class Program {
static void Main(string[] args) {
var nums = Converter(Console.ReadLine());
Console.WriteLine(Calc(nums));
}
static int[] Converter(string str) {
return Array.ConvertAll(str.Split(' '), int.Parse);
}
static int Calc(int[] array) {
int count = 0;
for (int i = array[0]; i <= array[1]; i++)
if (array[2] % i == 0)
count++;
return count;
}
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 127
| 2
|
using System;
class Program {
static void Main() {
string[] s = Console.ReadLine().Split(' ');
// 0:a, 1:b, 2:c
int[] i = new int[s.Length];
int c = 0;
for (int j = 0; j < s.Length; j++)
i[j] = int.Parse(s[j]);
for (int j = i[0]; j < i[1]; j++) {
if ((i[2] % j) == 0)
c++;
}
Console.WriteLine(c.ToString());
}
}
|
using System;
class Program {
static void Main() {
string[] s = Console.ReadLine().Split(' ');
// 0:a, 1:b, 2:c
int[] i = new int[s.Length];
int c = 0;
for (int j = 0; j < s.Length; j++)
i[j] = int.Parse(s[j]);
for (int j = i[0]; j <= i[1]; j++) {
if ((i[2] % j) == 0)
c++;
}
Console.WriteLine(c.ToString());
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 131
| 2
|
using System;
namespace ConsoleApp2 {
class Program {
static void Main(string[] args) {
int a = 0, b = 0, c = 0, count = 0;
string[] str = Console.ReadLine().Split(' ');
a = int.Parse(str[0]);
b = int.Parse(str[1]);
c = int.Parse(str[2]);
for (; a < b; a++) {
if (c % a == 0)
count++;
}
Console.WriteLine("{0}", count);
}
}
}
|
using System;
namespace ConsoleApp2 {
class Program {
static void Main(string[] args) {
int a = 0, b = 0, c = 0, count = 0;
string[] str = Console.ReadLine().Split(' ');
a = int.Parse(str[0]);
b = int.Parse(str[1]);
c = int.Parse(str[2]);
for (; a < b + 1; a++) {
if (c % a == 0)
count++;
}
Console.WriteLine("{0}", count);
}
}
}
|
[["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 203]]
| 8
| 127
| 2
|
using System;
using System.Collections.Generic;
class Program {
static void Main(string[] args) {
string[] str = Console.ReadLine().Split(' ');
int a = int.Parse(str[0]);
int b = int.Parse(str[1]);
int c = int.Parse(str[2]);
int count = 0;
for (var i = a; i < b; i++) {
if (c % i == 0) {
count += 1;
}
}
Console.WriteLine(count);
}
}
|
using System;
using System.Collections.Generic;
class Program {
static void Main(string[] args) {
string[] str = Console.ReadLine().Split(' ');
int a = int.Parse(str[0]);
int b = int.Parse(str[1]);
int c = int.Parse(str[2]);
int count = 0;
for (var i = a; i <= b; i++) {
if (c % i == 0) {
count += 1;
}
}
Console.WriteLine(count);
}
}
|
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 124
| 2
|
using System;
namespace ConsoleApplication16 {
class Program {
static void Main(string[] args) {
int a, b;
double d, r, f;
string[] s = Console.ReadLine().Split(' ');
a = int.Parse(s[0]);
b = int.Parse(s[1]);
d = a / b;
r = a % b;
f = a % b + 0.5;
Console.WriteLine(d + " " + r + " " + f.ToString("F5"));
}
}
}
|
using System;
namespace ConsoleApplication16 {
class Program {
static void Main(string[] args) {
int a, b;
double d, r, f;
string[] s = Console.ReadLine().Split(' ');
a = int.Parse(s[0]);
b = int.Parse(s[1]);
d = a / b;
r = a % b;
f = (double)a / b;
Console.WriteLine(d + " " + r + " " + f.ToString("F5"));
}
}
}
|
[["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 39, 199], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 109], ["+", 8, 196, 0, 1, 0, 11, 12, 16, 17, 85], ["-", 8, 196, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 8, 196, 0, 1, 0, 11, 12, 16, 12, 250]]
| 8
| 122
| 7
|
using System;
namespace ITP1_4_A {
class Program {
static void Main(string[] args) {
string[] strAry = Console.ReadLine().Split(' ');
int v0, v1;
double v2;
v0 = int.Parse(strAry[0]) / int.Parse(strAry[1]);
v1 = int.Parse(strAry[0]) % int.Parse(strAry[1]);
// v2 = 1.0 * int.Parse(strAry[0]) / int.Parse(strAry[1]);
v2 = double.Parse(strAry[0]) / double.Parse(strAry[1]);
Console.WriteLine("{0} {1} {2:#.#####}", v0, v1, v2);
}
}
}
|
using System;
namespace ITP1_4_A {
class Program {
static void Main(string[] args) {
string[] strAry = Console.ReadLine().Split(' ');
int v0, v1;
double v2;
v0 = int.Parse(strAry[0]) / int.Parse(strAry[1]);
v1 = int.Parse(strAry[0]) % int.Parse(strAry[1]);
v2 = double.Parse(strAry[0]) / double.Parse(strAry[1]);
Console.WriteLine("{0} {1} {2:F5}", v0, v1, v2);
}
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 130
| 2
|
using System;
class Program {
static void Main() {
string[] ab = Console.ReadLine().Split(' ');
int a = int.Parse(ab[0]);
int b = int.Parse(ab[1]);
int d = a / b;
int r = a % b;
double f = a / b;
Console.WriteLine("{0} {1} {2:f5}", d, r, f);
}
}
|
using System;
class Program {
static void Main() {
string[] ab = Console.ReadLine().Split(' ');
int a = int.Parse(ab[0]);
int b = int.Parse(ab[1]);
int d = a / b;
int r = a % b;
double f = (double)a / (double)b;
Console.WriteLine("{0} {1} {2:f5}", d, r, f);
}
}
|
[["+", 0, 200, 0, 212, 0, 16, 31, 74, 0, 24], ["+", 0, 200, 0, 212, 0, 16, 31, 74, 39, 199], ["+", 0, 200, 0, 212, 0, 16, 31, 74, 0, 25], ["+", 0, 200, 0, 212, 0, 16, 12, 74, 0, 24], ["+", 0, 200, 0, 212, 0, 16, 12, 74, 39, 199], ["+", 0, 200, 0, 212, 0, 16, 12, 74, 0, 25]]
| 8
| 94
| 6
|
using System;
namespace Sample1 {
class Program {
static void Main(string[] args) {
string input = Console.ReadLine();
int a = int.Parse(input.Split(' ')[0]);
int b = int.Parse(input.Split(' ')[1]);
long af = a;
long bf = b;
Console.WriteLine("{0} {1} {2}", a / b, a % b,
(af / bf).ToString("0.000000000000000"));
}
}
}
|
using System;
namespace Sample1 {
class Program {
static void Main(string[] args) {
string input = Console.ReadLine();
int a = int.Parse(input.Split(' ')[0]);
int b = int.Parse(input.Split(' ')[1]);
double af = a;
double bf = b;
Console.WriteLine("{0} {1} {2}", a / b, a % b,
(af / bf).ToString("0.00000000"));
}
}
}
|
[["-", 0, 195, 8, 196, 0, 197, 0, 198, 39, 199], ["+", 0, 195, 8, 196, 0, 197, 0, 198, 39, 199], ["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 111
| 6
|
using System;
namespace ConsoleApp7 {
class Program {
static void Main(string[] args) {
var A = Console.ReadLine().Split(' ');
int a = int.Parse(A[0]);
int b = int.Parse(A[1]);
double c = a;
double d = b;
Console.Write("{0} ,{1} ", a / b, a % b);
Console.WriteLine((c / d).ToString("0.00000000"));
Console.ReadKey();
}
}
}
|
using System;
namespace ConsoleApp7 {
class Program {
static void Main(string[] args) {
var A = Console.ReadLine().Split(' ');
int a = int.Parse(A[0]);
int b = int.Parse(A[1]);
double c = a;
double d = b;
Console.Write("{0} {1} ", a / b, a % b);
Console.WriteLine((c / d).ToString("0.00000000"));
Console.ReadKey();
}
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 115
| 2
|
using System;
class ABProblem {
static void Main(string[] args) {
string[] str = Console.ReadLine().Split(' ');
int a = int.Parse(str[0]);
int b = int.Parse(str[1]);
int d = a / b;
int r = a % b;
double f = (double)a / (double)b;
Console.WriteLine("{0} {1} {2.8}", d, r, f);
}
}
|
using System;
class ABProblem {
static void Main(string[] args) {
string[] str = Console.ReadLine().Split(' ');
int a = int.Parse(str[0]);
int b = int.Parse(str[1]);
int d = a / b;
int r = a % b;
double f = (double)a / (double)b;
Console.WriteLine("{0} {1} {2:f5}", d, r, f);
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 104
| 2
|
using System;
using System.Linq;
namespace Number {
class Program {
static void Main(string[] args) {
string s = Console.ReadLine();
double[] n = s.Split(' ').Select(e => double.Parse(e)).ToArray();
double a = n[0];
double b = n[1];
Console.WriteLine("{0} {1} {2}", (int)(a / b), (int)(a % b),
(a / b).ToString("F"));
}
}
}
|
using System;
using System.Linq;
namespace Number {
class Program {
static void Main(string[] args) {
string s = Console.ReadLine();
double[] n = s.Split(' ').Select(e => double.Parse(e)).ToArray();
double a = n[0];
double b = n[1];
Console.WriteLine("{0} {1} {2}", (int)(a / b), (int)(a % b),
(a / b).ToString("0.000000"));
}
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 122
| 2
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace aoj1 {
class Program {
static void Main() {
int[] num = IntInput();
int a = num[0];
int b = num[1];
Console.WriteLine("{0} {1} {2:f}", a / b, a % b, (double)a / (double)b);
}
static int[] IntInput() {
string[] strs = Console.ReadLine().Split(' ');
int[] numbers = new int[strs.Length];
for (int i = 0; i < strs.Length; i++) {
numbers[i] = int.Parse(strs[i]);
}
return numbers;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace aoj1 {
class Program {
static void Main() {
int[] num = IntInput();
int a = num[0];
int b = num[1];
Console.WriteLine("{0} {1} {2:f6}", a / b, a % b, (double)a / (double)b);
}
static int[] IntInput() {
string[] strs = Console.ReadLine().Split(' ');
int[] numbers = new int[strs.Length];
for (int i = 0; i < strs.Length; i++) {
numbers[i] = int.Parse(strs[i]);
}
return numbers;
}
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 163
| 2
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Circle {
class Program {
static void Main(string[] args) {
double r = double.Parse(Console.ReadLine());
Console.WriteLine("{0:f6}, {1:f6}", Math.PI * r * r, 2 * Math.PI * r);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Circle {
class Program {
static void Main(string[] args) {
double r = double.Parse(Console.ReadLine());
Console.WriteLine("{0:f6} {1:f6}", Math.PI * r * r, 2 * Math.PI * r);
}
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 85
| 2
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace radius {
class Program {
static void Main(string[] args) {
double r, area, circumference;
r = double.Parse(Console.ReadLine());
area = r * r * 3.14;
circumference = 2 * Math.PI * r;
Console.WriteLine("{0:f6} {1:f6}", area, circumference);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace radius {
class Program {
static void Main(string[] args) {
double r, area, circumference;
r = double.Parse(Console.ReadLine());
area = r * r * Math.PI;
circumference = 2 * Math.PI * r;
Console.WriteLine("{0:f6} {1:f6}", area, circumference);
}
}
}
|
[["-", 8, 196, 0, 1, 0, 11, 12, 16, 12, 250], ["+", 0, 1, 0, 11, 12, 16, 12, 214, 205, 22], ["+", 0, 1, 0, 11, 12, 16, 12, 214, 0, 131], ["+", 0, 1, 0, 11, 12, 16, 12, 214, 141, 22]]
| 8
| 90
| 4
|
using System;
class program {
public static int Main() {
var r = double.Parse(Console.ReadLine());
var pi = System.Math.PI;
Console.WriteLine("{0:f6} {1:f6}", 2 * r * pi, r * r * pi);
return 0;
}
}
|
using System;
class program {
public static int Main() {
var r = double.Parse(Console.ReadLine());
var pi = System.Math.PI;
Console.WriteLine("{0:f6} {1:f6}", r * r * pi, 2 * r * pi);
return 0;
}
}
|
[["-", 3, 4, 0, 28, 0, 16, 31, 16, 31, 203], ["+", 3, 4, 0, 28, 0, 16, 31, 16, 31, 22], ["-", 3, 4, 0, 28, 0, 16, 31, 16, 31, 22], ["+", 3, 4, 0, 28, 0, 16, 31, 16, 31, 203]]
| 8
| 62
| 4
|
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2 {
class Program {
static void Main(string[] args) {
string s = Console.ReadLine();
double r = double.Parse(s);
double pi = 3.14159275;
double area = r * r * pi;
double ensyu = r * pi * 2;
string area2 = string.Format("{0:f6}", area);
string ensyu2 = string.Format("{0:f6}", ensyu);
Console.WriteLine(area2 + " " + ensyu2);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2 {
class Program {
static void Main(string[] args) {
string s = Console.ReadLine();
double r = double.Parse(s);
double pi = 3.14159265358979323846;
double area = r * r * pi;
double ensyu = r * pi * 2;
string area2 = string.Format("{0:f6}", area);
string ensyu2 = string.Format("{0:f6}", ensyu);
Console.WriteLine(area2 + " " + ensyu2);
}
}
}
|
[["-", 0, 197, 0, 198, 0, 200, 0, 212, 0, 250], ["+", 0, 197, 0, 198, 0, 200, 0, 212, 0, 250]]
| 8
| 117
| 2
|
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication9 {
class Program {
static void Main(string[] args) {
String str = Console.ReadLine();
double r = double.Parse(str);
double x, y;
x = 2.0 * Math.PI * r;
y = Math.PI * r * r;
Console.WriteLine(x.ToString("f8") + " " + y.ToString("f8"));
}
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication9 {
class Program {
static void Main(string[] args) {
String str = Console.ReadLine();
double r = double.Parse(str);
double x, y;
x = 2.0 * Math.PI * r;
y = Math.PI * r * r;
Console.WriteLine(y.ToString("f6") + " " + x.ToString("f6"));
}
}
}
|
[["-", 0, 16, 31, 16, 31, 213, 63, 214, 205, 22], ["+", 0, 16, 31, 16, 31, 213, 63, 214, 205, 22], ["-", 31, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 31, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["-", 0, 28, 0, 16, 12, 213, 63, 214, 205, 22], ["+", 0, 28, 0, 16, 12, 213, 63, 214, 205, 22], ["-", 12, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 12, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 105
| 8
|
using System;
namespace ConsoleApplication13 {
class Program {
static void Main(string[] args) {
double x, y;
String s = Console.ReadLine();
double r = double.Parse(s);
x = 2 * 3.141592653589 * r;
y = 3.141592653589 * r * r;
Console.WriteLine(x.ToString("F6") + " " + y.ToString("F6"));
}
}
}
|
using System;
namespace ConsoleApplication13 {
class Program {
static void Main(string[] args) {
double x, y;
String s = Console.ReadLine();
double r = double.Parse(s);
x = 2 * 3.141592653589 * r;
y = 3.141592653589 * r * r;
Console.WriteLine(y.ToString("F6") + " " + x.ToString("F6"));
}
}
}
|
[["-", 0, 16, 31, 16, 31, 213, 63, 214, 205, 22], ["+", 0, 16, 31, 16, 31, 213, 63, 214, 205, 22], ["-", 0, 28, 0, 16, 12, 213, 63, 214, 205, 22], ["+", 0, 28, 0, 16, 12, 213, 63, 214, 205, 22]]
| 8
| 89
| 4
|
using System;
namespace test {
class program {
static void Main() {
double r = double.Parse(Console.ReadLine());
double s = r * r * 3.14159265;
double l = 2 * r * 3.14159265;
Console.WriteLine("{0:f6} {1:f6}", s, l);
}
}
}
|
using System;
namespace test {
class program {
static void Main() {
double r = double.Parse(Console.ReadLine());
double s = r * r * 3.141592653589;
double l = 2 * r * 3.141592653589;
Console.WriteLine("{0:f6} {1:f6}", s, l);
}
}
}
|
[["-", 0, 198, 0, 200, 0, 212, 0, 16, 12, 250], ["+", 0, 198, 0, 200, 0, 212, 0, 16, 12, 250]]
| 8
| 63
| 4
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication9 {
class Program {
static void Main(string[] args) {
double a = double.Parse(Console.ReadLine());
double d = a * 2 * Math.PI;
double b = a * a * Math.PI;
Console.WriteLine("{0:F10} {1:F10}", d, b);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication9 {
class Program {
static void Main(string[] args) {
double a = double.Parse(Console.ReadLine());
double d = a * 2 * Math.PI;
double b = a * a * Math.PI;
Console.WriteLine("{0:F10} {1:F10}", b, d);
}
}
}
|
[["-", 0, 1, 0, 213, 3, 4, 0, 28, 0, 22], ["-", 8, 196, 0, 1, 0, 213, 3, 4, 0, 21], ["+", 8, 196, 0, 1, 0, 213, 3, 4, 0, 21], ["+", 0, 1, 0, 213, 3, 4, 0, 28, 0, 22]]
| 8
| 88
| 4
|
using System;
namespace AOJ {
class Program {
static void Main(string[] args) {
{
var read = Console.ReadLine();
// var temp_string = read.Split(' ');
double radius = double.Parse(read);
double area = radius * radius * 3.14, Circumference = radius * 2 * 3.14;
Console.WriteLine(area + " " + Circumference);
}
}
}
}
|
using System;
namespace AOJ {
class Program {
static void Main(string[] args) {
{
var read = Console.ReadLine();
// var temp_string = read.Split(' ');
double radius = double.Parse(read);
double area = radius * radius * Math.PI,
Circumference = radius * 2 * Math.PI;
Console.WriteLine(area + " " + Circumference);
}
}
}
}
|
[["-", 0, 198, 0, 200, 0, 212, 0, 16, 12, 250], ["+", 0, 200, 0, 212, 0, 16, 12, 214, 205, 22], ["+", 0, 200, 0, 212, 0, 16, 12, 214, 0, 131], ["+", 0, 200, 0, 212, 0, 16, 12, 214, 141, 22]]
| 8
| 74
| 8
|
using System;
class ITP1_4_B {
public static void Main() {
double r = double.Parse(Console.ReadLine());
double area = r * r * 3.141592653;
double length = r * 2 * 3.141592653;
Console.WriteLine(area + " " + length);
}
}
|
using System;
class ITP1_4_B {
public static void Main() {
double r = double.Parse(Console.ReadLine());
double area = r * r * Math.PI;
double length = r * 2 * Math.PI;
Console.WriteLine(area + " " + length);
}
}
|
[["-", 0, 198, 0, 200, 0, 212, 0, 16, 12, 250], ["+", 0, 200, 0, 212, 0, 16, 12, 214, 205, 22], ["+", 0, 200, 0, 212, 0, 16, 12, 214, 0, 131], ["+", 0, 200, 0, 212, 0, 16, 12, 214, 141, 22]]
| 8
| 60
| 8
|
using System;
public class Class1 {
public static void Main(String[] args) {
double r = double.Parse(Console.ReadLine());
double a = 2d * r * Math.PI;
double b = r * r * Math.PI;
Console.WriteLine("{0:f5} {1:f5}", a, b);
}
}
|
using System;
public class Class1 {
public static void Main(String[] args) {
double r = double.Parse(Console.ReadLine());
double b = 2d * r * Math.PI;
double a = r * r * Math.PI;
Console.WriteLine("{0} {1}", a, b);
}
}
|
[["-", 8, 196, 0, 197, 0, 198, 0, 200, 141, 22], ["+", 8, 196, 0, 197, 0, 198, 0, 200, 141, 22], ["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 69
| 6
|
using System;
class Program {
static void Main() {
double r = double.Parse(Console.ReadLine());
double length = r * 2 * Math.PI;
double area = r * r * Math.PI;
Console.WriteLine("{0:f6} {1:f6}", length, area);
}
}
|
using System;
class Program {
static void Main() {
double r = double.Parse(Console.ReadLine());
double length = r * 2 * Math.PI;
double area = r * r * Math.PI;
Console.WriteLine("{0:f6} {1:f6}", area, length);
}
}
|
[["-", 0, 1, 0, 213, 3, 4, 0, 28, 0, 22], ["-", 8, 196, 0, 1, 0, 213, 3, 4, 0, 21], ["+", 8, 196, 0, 1, 0, 213, 3, 4, 0, 21], ["+", 0, 1, 0, 213, 3, 4, 0, 28, 0, 22]]
| 8
| 63
| 4
|
using System;
class P {
public static void Main() {
//????????????????????????
double r = Double.Parse(Console.ReadLine());
//?????¨???
double pi = 3.1516926;
//??¢???
double S = pi * r * r;
//?????¨
double L = 2 * pi * r;
//??¨???
Console.WriteLine("{0:f5} {1:f5}", S, L);
}
}
|
using System;
class P {
public static void Main() {
//????????????????????????
double r = Double.Parse(Console.ReadLine());
//?????¨???
double pi = Math.PI;
//??¢???
double S = pi * r * r;
//?????¨
double L = 2 * pi * r;
//??¨???
Console.WriteLine("{0:f5} {1:f5}", S, L);
}
}
|
[["-", 0, 197, 0, 198, 0, 200, 0, 212, 0, 250], ["+", 0, 198, 0, 200, 0, 212, 0, 214, 205, 22], ["+", 0, 198, 0, 200, 0, 212, 0, 214, 0, 131], ["+", 0, 198, 0, 200, 0, 212, 0, 214, 141, 22]]
| 8
| 70
| 4
|
// ITP1_4_B
using System;
using System.Collections.Generic;
/*using System.Linq;
using System.Text;
using System.Threading.Tasks;*/
class Program {
static void Main(string[] args) {
//?????????????????????????????????int??????iaaray????????????????????\
double r = double.Parse(Console.ReadLine());
double pai = 3.14159;
double s = r * r * pai;
double c = r * 2.000000 * pai;
Console.WriteLine(s.ToString("0.000000") + " " + c.ToString("0.000000"));
}
}
|
// ITP1_4_B
using System;
using System.Collections.Generic;
/*using System.Linq;
using System.Text;
using System.Threading.Tasks;*/
class Program {
static void Main(string[] args) {
//?????????????????????????????????int??????iaaray????????????????????\
double r = double.Parse(Console.ReadLine());
double pai = 3.141592653589793;
double s = r * r * pai;
double c = r * 2.000000 * pai;
Console.WriteLine(s.ToString("0.000000") + " " + c.ToString("0.000000"));
}
}
|
[["-", 0, 197, 0, 198, 0, 200, 0, 212, 0, 250], ["+", 0, 197, 0, 198, 0, 200, 0, 212, 0, 250]]
| 8
| 92
| 2
|
using System;
namespace Sample1 {
class Program {
static void Main(string[] args) {
string input = Console.ReadLine();
double a = double.Parse(input.Split(' ')[0]);
Console.WriteLine("{0} {1}", (2 * a * Math.PI).ToString("F6"),
(a * a * Math.PI).ToString("F6"));
}
}
}
|
using System;
namespace Sample1 {
class Program {
static void Main(string[] args) {
string input = Console.ReadLine();
double a = double.Parse(input.Split(' ')[0]);
Console.WriteLine("{1} {0}", (2 * a * Math.PI).ToString("F6"),
(a * a * Math.PI).ToString("F6"));
}
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 94
| 2
|
using System;
class Program {
static void Main(string[] args) {
int n = int.Parse(Console.ReadLine());
string bar = "####################";
int[] checklist = new int[120];
for (int i = 0; i < n; i++) {
string[] data = Console.ReadLine().Split(' ');
int b = int.Parse(data[0]);
int f = int.Parse(data[1]);
int r = int.Parse(data[2]);
int v = int.Parse(data[3]);
int index = 0;
index = (b - 1) * 30 + (f - 1) * 10 + r - 1;
checklist[index] += v;
}
for (int i = 0; i < 12; i++) {
string line = "";
for (int j = i * 10; j < 10 + i * 10; j++) {
line = line + " " + checklist[j];
}
Console.WriteLine(line);
if ((i + 1) % 3 == 0) {
Console.WriteLine(bar);
}
}
}
}
|
using System;
class Program {
static void Main(string[] args) {
int n = int.Parse(Console.ReadLine());
string bar = "####################";
int[] checklist = new int[120];
for (int i = 0; i < n; i++) {
string[] data = Console.ReadLine().Split(' ');
int b = int.Parse(data[0]);
int f = int.Parse(data[1]);
int r = int.Parse(data[2]);
int v = int.Parse(data[3]);
int index = 0;
index = (b - 1) * 30 + (f - 1) * 10 + r - 1;
checklist[index] += v;
}
for (int i = 0; i < 12; i++) {
string line = "";
for (int j = i * 10; j < 10 + i * 10; j++) {
line = line + " " + checklist[j];
}
Console.WriteLine(line);
if (i != 11 && (i + 1) % 3 == 0) {
Console.WriteLine(bar);
}
}
}
}
|
[["+", 8, 196, 0, 57, 15, 16, 31, 16, 31, 22], ["+", 8, 196, 0, 57, 15, 16, 31, 16, 17, 79], ["+", 8, 196, 0, 57, 15, 16, 31, 16, 12, 203], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 17, 98]]
| 8
| 255
| 4
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Prac {
class Program {
static void Main(string[] args) {
var House = new int[10, 3, 4];
for (var i = 0; i < 10; i++)
for (var j = 0; j < 3; j++)
for (var k = 4; k < 4; k++)
House[i, j, k] = 0;
var n = int.Parse(Console.ReadLine());
var temp = new int[4];
for (var i = 0; i < n; i++) {
temp = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
House[temp[2] - 1, temp[1] - 1, temp[0] - 1] += temp[3];
}
for (var i = 0; i < 4; i++) {
for (var j = 0; j < 3; j++) {
for (var k = 0; k < 10; k++) {
Console.Write(" " + House[k, j, i]);
}
Console.WriteLine();
}
Console.WriteLine("####################");
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Prac {
class Program {
static void Main(string[] args) {
var House = new int[10, 3, 4];
for (var i = 0; i < 10; i++)
for (var j = 0; j < 3; j++)
for (var k = 4; k < 4; k++)
House[i, j, k] = 0;
var n = int.Parse(Console.ReadLine());
var temp = new int[4];
for (var i = 0; i < n; i++) {
temp = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
House[temp[2] - 1, temp[1] - 1, temp[0] - 1] += temp[3];
}
for (var i = 0; i < 4; i++) {
for (var j = 0; j < 3; j++) {
for (var k = 0; k < 10; k++) {
Console.Write(" " + House[k, j, i]);
}
Console.WriteLine();
}
if (i != 3)
Console.WriteLine("####################");
}
}
}
}
|
[["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 24], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 31, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 17, 79], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 12, 203], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 25]]
| 8
| 280
| 6
|
using System;
namespace AOJ_ITP16_OfficialHouse {
class MainClass {
public static void Main(string[] args) {
int[,,] room = new int[4, 3, 10]; // [棟][階][部屋]
for (int i = 0; i < 4; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 10; k++)
room[i, j, k] = 0;
int b, f, r, v; // b棟f階のr番目の部屋にv人
int n = int.Parse(Console.ReadLine());
for (int i = 0; i < n; i++) {
string[] dtmp = Console.ReadLine().Split(" ".ToCharArray());
b = int.Parse(dtmp[0]) - 1;
f = int.Parse(dtmp[1]) - 1;
r = int.Parse(dtmp[2]) - 1;
v = int.Parse(dtmp[3]);
room[b, f, r] += v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write("{0:D2}", room[i, j, k]);
}
Console.Write("\n");
}
if (i != 3)
Console.WriteLine("####################");
}
}
}
}
|
using System;
namespace AOJ_ITP16_OfficialHouse {
class MainClass {
public static void Main(string[] args) {
int[,,] room = new int[4, 3, 10]; // [棟][階][部屋]
for (int i = 0; i < 4; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 10; k++)
room[i, j, k] = 0;
int b, f, r, v; // b棟f階のr番目の部屋にv人
int n = int.Parse(Console.ReadLine());
for (int i = 0; i < n; i++) {
string[] dtmp = Console.ReadLine().Split(" ".ToCharArray());
b = int.Parse(dtmp[0]) - 1;
f = int.Parse(dtmp[1]) - 1;
r = int.Parse(dtmp[2]) - 1;
v = int.Parse(dtmp[3]);
room[b, f, r] += v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" {0}", room[i, j, k]);
}
Console.Write("\n");
}
if (i != 3)
Console.WriteLine("####################");
}
}
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 311
| 2
|
using System;
namespace OfficialHouse {
class MainClass {
public static void Main(string[] args) {
int[,,] room = new int[4, 3, 10];
int b, f, r, v;
string inputn = Console.ReadLine();
int n = int.Parse(inputn);
for (int i = 0; i < n; i++) {
string[] str = Console.ReadLine().Split(' ');
b = int.Parse(str[0]);
f = int.Parse(str[1]);
r = int.Parse(str[2]);
v = int.Parse(str[3]);
room[b - 1, f - 1, r - 1] += v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" ", room[i, j, k]);
}
Console.Write("\n");
}
if (i < 3)
Console.WriteLine("####################");
}
}
}
}
|
using System;
namespace OfficialHouse {
class MainClass {
public static void Main(string[] args) {
int[,,] room = new int[4, 3, 10];
int b, f, r, v;
string inputn = Console.ReadLine();
int n = int.Parse(inputn);
for (int i = 0; i < n; i++) {
string[] str = Console.ReadLine().Split(' ');
b = int.Parse(str[0]);
f = int.Parse(str[1]);
r = int.Parse(str[2]);
v = int.Parse(str[3]);
room[b - 1, f - 1, r - 1] += v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" {0}", room[i, j, k]);
}
Console.Write("\n");
}
if (i < 3)
Console.WriteLine("####################");
}
}
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 257
| 2
|
using System;
using System.Text;
public class Test {
static public void Main() {
int n = int.Parse(Console.ReadLine());
int[,,] oh = new int[4, 3, 10];
for (int i = 0; i < n; i++) {
string[] strs = Console.ReadLine().Split(' ');
int b = int.Parse(strs[0]) - 1;
int f = int.Parse(strs[1]) - 1;
int r = int.Parse(strs[2]) - 1;
oh[b, f, r] = int.Parse(strs[3]);
}
StringBuilder output = new StringBuilder();
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
output.Append(string.Format(" {0}", oh[i, j, k]));
}
output.Append("\n");
}
if (3 != i) {
output.AppendLine("####################");
}
}
Console.Write(output);
}
}
|
using System;
using System.Text;
public class Test {
static public void Main() {
int n = int.Parse(Console.ReadLine());
int[,,] oh = new int[4, 3, 10];
for (int i = 0; i < n; i++) {
string[] strs = Console.ReadLine().Split(' ');
int b = int.Parse(strs[0]) - 1;
int f = int.Parse(strs[1]) - 1;
int r = int.Parse(strs[2]) - 1;
oh[b, f, r] += int.Parse(strs[3]);
}
StringBuilder output = new StringBuilder();
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
output.Append(string.Format(" {0}", oh[i, j, k]));
}
output.Append("\n");
}
if (3 != i) {
output.AppendLine("####################");
}
}
Console.Write(output);
}
}
|
[["-", 8, 196, 0, 1, 0, 11, 0, 202, 0, 32], ["+", 8, 196, 0, 1, 0, 11, 0, 202, 0, 107]]
| 8
| 262
| 2
|
using System;
namespace ConsoleApplication2 {
class Program {
static void Main(string[] args) {
int[,,] Total = new int[4, 3, 10];
for (int z = 0; z < 4; z++) {
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 10; x++) {
Total[z, y, x] = 0;
}
}
}
String N = Console.ReadLine();
int n = int.Parse(N);
for (int i = 0; i < n; i++) {
String[] input = Console.ReadLine().Split(' ');
int b = int.Parse(input[0]) - 1;
int f = int.Parse(input[1]) - 1;
int r = int.Parse(input[2]) - 1;
int V = Total[b, f, r];
int v = int.Parse(input[3]);
Total[b, f, r] = V + v;
}
for (int z = 0; z < 4; z++) {
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 10; x++) {
switch (z) {
case 0:
Console.Write(" " + Total[z, y, x]);
break;
case 1:
Console.Write(" " + Total[z, y, x]);
break;
case 2:
Console.Write(" " + Total[z, y, x]);
break;
case 3:
Console.Write(" " + Total[z, y, x]);
break;
}
}
Console.WriteLine("");
}
Console.WriteLine("####################");
}
}
}
}
|
using System;
namespace ConsoleApplication2 {
class Program {
static void Main(string[] args) {
int[,,] Total = new int[4, 3, 10];
for (int z = 0; z < 4; z++) {
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 10; x++) {
Total[z, y, x] = 0;
}
}
}
String N = Console.ReadLine();
int n = int.Parse(N);
for (int i = 0; i < n; i++) {
String[] input = Console.ReadLine().Split(' ');
int b = int.Parse(input[0]) - 1;
int f = int.Parse(input[1]) - 1;
int r = int.Parse(input[2]) - 1;
int V = Total[b, f, r];
int v = int.Parse(input[3]);
Total[b, f, r] = V + v;
}
for (int z = 0; z < 4; z++) {
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 10; x++) {
switch (z) {
case 0:
Console.Write(" " + Total[z, y, x]);
break;
case 1:
Console.Write(" " + Total[z, y, x]);
break;
case 2:
Console.Write(" " + Total[z, y, x]);
break;
case 3:
Console.Write(" " + Total[z, y, x]);
break;
}
}
Console.WriteLine("");
}
if (z != 3)
Console.WriteLine("####################");
}
}
}
}
|
[["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 24], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 31, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 17, 79], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 12, 203], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 25]]
| 8
| 397
| 6
|
using System;
class MainClass {
public static void Main() {
int width = 10;
int height = 15;
int n = int.Parse(Console.ReadLine());
string[] infoArray = new string[n];
string[,] allArray = new string[height, width];
// Init allArray, infoArray
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
if ((i + 1) % 4 == 0) {
allArray[i, j] = "#";
} else {
allArray[i, j] = "0";
}
}
}
// Decide infoArray
for (; n > 0; n--) {
string[] inputs = Console.ReadLine().Split(' ');
int[] nums = Array.ConvertAll(inputs, int.Parse);
int b = nums[0], f = nums[1], r = nums[2], v = nums[3];
int i = (b * 4 - 4) + f - 1;
int j = r - 1;
infoArray[n - 1] = i + " " + j + " " + v;
}
// Caluc v
for (int i = 0; i < infoArray.Length; i++) {
int[] xyArray = Array.ConvertAll(infoArray[i].Split(' '), int.Parse);
int allArrayV = int.Parse(allArray[xyArray[0], xyArray[1]]);
allArrayV += xyArray[2];
allArray[xyArray[0], xyArray[1]] = allArrayV.ToString();
}
// Display allArray
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
Console.Write(allArray[i, j]);
}
Console.WriteLine();
}
}
}
|
using System;
class MainClass {
public static void Main() {
int width = 10;
int height = 15;
int n = int.Parse(Console.ReadLine());
string[] infoArray = new string[n];
string[,] allArray = new string[height, width];
// Init allArray, infoArray
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
if ((i + 1) % 4 == 0) {
allArray[i, j] = "##";
} else {
allArray[i, j] = " 0";
}
}
}
// Decide infoArray
for (; n > 0; n--) {
string[] inputs = Console.ReadLine().Split(' ');
int[] nums = Array.ConvertAll(inputs, int.Parse);
int b = nums[0], f = nums[1], r = nums[2], v = nums[3];
int i = (b * 4 - 4) + f - 1;
int j = r - 1;
infoArray[n - 1] = i + " " + j + " " + v;
}
// Caluc v
for (int i = 0; i < infoArray.Length; i++) {
int[] xyArray = Array.ConvertAll(infoArray[i].Split(' '), int.Parse);
int allArrayV = int.Parse(allArray[xyArray[0], xyArray[1]]);
allArrayV += xyArray[2];
allArray[xyArray[0], xyArray[1]] = " " + allArrayV.ToString();
}
// Display allArray
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
Console.Write(allArray[i, j]);
}
Console.WriteLine();
}
}
}
|
[["-", 64, 196, 0, 1, 0, 11, 12, 5, 0, 222], ["+", 64, 196, 0, 1, 0, 11, 12, 5, 0, 222], ["-", 75, 196, 0, 1, 0, 11, 12, 5, 0, 222], ["+", 75, 196, 0, 1, 0, 11, 12, 5, 0, 222], ["+", 0, 1, 0, 11, 12, 16, 31, 5, 0, 62], ["+", 0, 1, 0, 11, 12, 16, 31, 5, 0, 222], ["+", 8, 196, 0, 1, 0, 11, 12, 16, 17, 72]]
| 8
| 398
| 8
|
using System;
class Program {
static void Main(string[] args) {
Input CInput = new Input();
// EasyTask CEasyTask = new EasyTask();
// int input = 0;
// int[] input = new int[(int)Input.Define.MAX_ArraySize];
// int[,] input = new int[(int)Input.Define.MAX_ArraySize,
// (int)Input.Define.ArraySize2d]; int num = 0; input = CInput.Line1_int();
// input = CInput.Multiline_int(' ', 2, ref num);
int[,,] DB = new int[4, 3, 10];
int[,] input2 =
new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
int buf = 0;
int input1 = CInput.Line1_int();
input2 = CInput.Multiline_int(' ', 4, ref buf, input1);
for (int i = 0; i < input1; i++) {
DB[input2[i, 0] - 1, input2[i, 1] - 1, input2[i, 2] - 1] += input2[i, 3];
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
System.Console.Write(" {0}", DB[i, j, k]);
}
System.Console.WriteLine();
}
System.Console.WriteLine("####################");
}
}
}
class Input {
public enum Define {
MAX_ArraySize = 1000000,
ArraySize2d = 4, // 2?¬?????????????[][?] ???????
}
public string Line1_string() { return Console.ReadLine(); }
public string[] Line1_string(int chr) {
var input = Console.ReadLine();
var split = input.Split(' ');
return split;
}
public int Line1_int() {
var input = Console.ReadLine();
return int.Parse(input);
}
public double Line1_double() {
var input = Console.ReadLine();
return double.Parse(input);
}
public int[] Line1_int(int chr, int num) {
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int i = 0; i < num; i++) {
spliti[i] = int.Parse(split[i]);
}
return spliti;
}
public int[] Multiline_int(ref int datanum) {
int i = 0;
int[] data = new int[(int)Input.Define.MAX_ArraySize];
while (true) {
var input = Console.ReadLine();
var value = int.Parse(input);
if (value == 0)
break;
data[i] = value;
i++;
}
datanum = i;
return data;
}
/// <summary>
/// ?????°??????int??????????????????????????????
/// </summary>
/// <param name="chr">???????????????</param>
/// <param name="num">?????????????????????????????°</param>
/// <param name="datanum">??????????????????????????°</param>
/// <returns></returns>
public int[,] Multiline_int(int chr, int num, ref int datanum,
int loadnum = 0) {
int i = 0;
int[,] data =
new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
while (true) {
if (loadnum != 0 && loadnum == i)
break;
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int j = 0; j < num; j++) {
spliti[j] = int.Parse(split[j]);
}
// if (spliti[0] == 0 && spliti[1] == 0) break; //
// ???????????????????????????
for (int j = 0; j < num; j++) {
data[i, j] = spliti[j];
}
i++;
}
datanum = i;
return data;
}
}
class EasyTask {
public void Swap(ref int a, ref int b) {
int buf = 0;
buf = a;
a = b;
b = buf;
}
}
|
using System;
class Program {
static void Main(string[] args) {
Input CInput = new Input();
// EasyTask CEasyTask = new EasyTask();
// int input = 0;
// int[] input = new int[(int)Input.Define.MAX_ArraySize];
// int[,] input = new int[(int)Input.Define.MAX_ArraySize,
// (int)Input.Define.ArraySize2d]; int num = 0; input = CInput.Line1_int();
// input = CInput.Multiline_int(' ', 2, ref num);
int[,,] DB = new int[4, 3, 10];
int[,] input2 =
new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
int buf = 0;
int input1 = CInput.Line1_int();
input2 = CInput.Multiline_int(' ', 4, ref buf, input1);
for (int i = 0; i < input1; i++) {
DB[input2[i, 0] - 1, input2[i, 1] - 1, input2[i, 2] - 1] += input2[i, 3];
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
System.Console.Write(" {0}", DB[i, j, k]);
}
System.Console.WriteLine();
}
if (i != 3)
System.Console.WriteLine("####################");
}
}
}
class Input {
public enum Define {
MAX_ArraySize = 1000000,
ArraySize2d = 4, // 2?¬?????????????[][?] ???????
}
public string Line1_string() { return Console.ReadLine(); }
public string[] Line1_string(int chr) {
var input = Console.ReadLine();
var split = input.Split(' ');
return split;
}
public int Line1_int() {
var input = Console.ReadLine();
return int.Parse(input);
}
public double Line1_double() {
var input = Console.ReadLine();
return double.Parse(input);
}
public int[] Line1_int(int chr, int num) {
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int i = 0; i < num; i++) {
spliti[i] = int.Parse(split[i]);
}
return spliti;
}
public int[] Multiline_int(ref int datanum) {
int i = 0;
int[] data = new int[(int)Input.Define.MAX_ArraySize];
while (true) {
var input = Console.ReadLine();
var value = int.Parse(input);
if (value == 0)
break;
data[i] = value;
i++;
}
datanum = i;
return data;
}
/// <summary>
/// ?????°??????int??????????????????????????????
/// </summary>
/// <param name="chr">???????????????</param>
/// <param name="num">?????????????????????????????°</param>
/// <param name="datanum">??????????????????????????°</param>
/// <returns></returns>
public int[,] Multiline_int(int chr, int num, ref int datanum,
int loadnum = 0) {
int i = 0;
int[,] data =
new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
while (true) {
if (loadnum != 0 && loadnum == i)
break;
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int j = 0; j < num; j++) {
spliti[j] = int.Parse(split[j]);
}
// if (spliti[0] == 0 && spliti[1] == 0) break; //
// ???????????????????????????
for (int j = 0; j < num; j++) {
data[i, j] = spliti[j];
}
i++;
}
datanum = i;
return data;
}
}
class EasyTask {
public void Swap(ref int a, ref int b) {
int buf = 0;
buf = a;
a = b;
b = buf;
}
}
|
[["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 24], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 31, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 17, 79], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 12, 203], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 25]]
| 8
| 749
| 6
|
using System;
class InOut {
int[,,] univ = new int[4, 3, 10];
public InOut(int n) {
for (int i = 0; i < n; i++) {
string[] s = Console.ReadLine().Split(' ');
int building = int.Parse(s[0]);
int floor = int.Parse(s[1]);
int room = int.Parse(s[2]);
int person = int.Parse(s[3]);
inout(building, floor, room, person);
}
}
public void inout(int build, int floor, int room, int person) {
univ[build - 1, floor - 1, room - 1] += person;
}
public void GetResult() {
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" " + univ[i, j, k]);
}
Console.WriteLine("");
}
Console.WriteLine(new string('#', 20));
}
}
}
class Program {
static void Main() {
int n = int.Parse(Console.ReadLine());
InOut io = new InOut(n);
io.GetResult();
}
}
|
using System;
class InOut {
int[,,] univ = new int[4, 3, 10];
public InOut(int n) {
for (int i = 0; i < n; i++) {
string[] s = Console.ReadLine().Split(' ');
int building = int.Parse(s[0]);
int floor = int.Parse(s[1]);
int room = int.Parse(s[2]);
int person = int.Parse(s[3]);
inout(building, floor, room, person);
}
}
public void inout(int build, int floor, int room, int person) {
univ[build - 1, floor - 1, room - 1] += person;
}
public void GetResult() {
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" " + univ[i, j, k]);
}
Console.WriteLine("");
}
if (i != 3)
Console.WriteLine(new string('#', 20));
}
}
}
class Program {
static void Main() {
int n = int.Parse(Console.ReadLine());
InOut io = new InOut(n);
io.GetResult();
}
}
|
[["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 24], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 31, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 17, 79], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 12, 203], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 25]]
| 8
| 300
| 6
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// using System.Threading.Tasks;
namespace ITP1_6C {
class Program {
static void Main(string[] args) {
// n????????????
// b?£?f??????r???????????¨?±????v???
//????????????????????????building[4][3][10]?????????
int[,,] building = new int[4, 3, 10];
int b, f, r, v;
//?????????0??§?????????
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
building[i, j, k] = 0;
}
}
}
//???????????°?????\??? n ?????£??\
int n = int.Parse(Console.ReadLine());
// n?????°?????????
for (int i = 0; i < n; i++) {
string[] indata = Console.ReadLine().Split(' ');
b = int.Parse(indata[0]) - 1;
f = int.Parse(indata[1]) - 1;
r = int.Parse(indata[2]) - 1;
v = int.Parse(indata[3]);
building[b, f, r] += v;
}
//??????
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" " + building[i, j, k]);
// if (k < 9) Console.Write(" ");
}
Console.Write("\n");
}
Console.WriteLine("####################");
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// using System.Threading.Tasks;
namespace ITP1_6C {
class Program {
static void Main(string[] args) {
// n????????????
// b?£?f??????r???????????¨?±????v???
//????????????????????????building[4][3][10]?????????
int[,,] building = new int[4, 3, 10];
int b, f, r, v;
//?????????0??§?????????
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
building[i, j, k] = 0;
}
}
}
//???????????°?????\??? n ?????£??\
int n = int.Parse(Console.ReadLine());
// n?????°?????????
for (int i = 0; i < n; i++) {
string[] indata = Console.ReadLine().Split(' ');
b = int.Parse(indata[0]) - 1;
f = int.Parse(indata[1]) - 1;
r = int.Parse(indata[2]) - 1;
v = int.Parse(indata[3]);
building[b, f, r] += v;
}
//??????
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" " + building[i, j, k]);
// if (k < 9) Console.Write(" ");
}
Console.Write("\n");
}
if (i < 3)
Console.WriteLine("####################");
}
}
}
}
|
[["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 24], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 31, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 17, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 12, 203], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 25]]
| 8
| 330
| 6
|
using System;
namespace CA {
class Program {
static void Main(string[] args) {
int i = int.Parse(Console.ReadLine());
int[,,] r = new int[4, 3, 10];
while (i-- != 0) {
string[] s = Console.ReadLine().Split(' ');
r[int.Parse(s[0]), int.Parse(s[1]), int.Parse(s[2])] += int.Parse(s[3]);
}
for (i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" " + r[i, j, k]);
}
Console.WriteLine();
}
if (i == 3)
break;
Console.WriteLine("####################");
}
}
}
}
|
using System;
namespace CA {
class Program {
static void Main(string[] args) {
int i = int.Parse(Console.ReadLine());
int[,,] r = new int[4, 3, 10];
while (i-- != 0) {
string[] s = Console.ReadLine().Split(' ');
r[int.Parse(s[0]) - 1, int.Parse(s[1]) - 1, int.Parse(s[2]) - 1] +=
int.Parse(s[3]);
}
for (i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" " + r[i, j, k]);
}
Console.WriteLine();
}
if (i == 3)
break;
Console.WriteLine("####################");
}
}
}
}
|
[["+", 31, 204, 206, 207, 0, 28, 0, 16, 17, 33], ["+", 31, 204, 206, 207, 0, 28, 0, 16, 12, 203]]
| 8
| 211
| 6
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program {
static void Main() {
int[,,] a = new int[4, 3, 10];
int b = int.Parse(Console.ReadLine());
for (int c = 0; c < b; c++) {
int[] d = Console.ReadLine().Split().Select(int.Parse).ToArray();
a[d[0] - 1, d[1] - 1, d[2] - 1] += d[3];
}
for (int e = 0; e < 4; e++) {
for (int f = 0; f < 3; f++) {
for (int g = 0; g < 10; g++) {
Console.Write(" " + a[e, f, g]);
}
}
if (e != 3)
Console.WriteLine("####################");
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program {
static void Main() {
int[,,] a = new int[4, 3, 10];
int b = int.Parse(Console.ReadLine());
for (int c = 0; c < b; c++) {
int[] d = Console.ReadLine().Split().Select(int.Parse).ToArray();
a[d[0] - 1, d[1] - 1, d[2] - 1] += d[3];
}
for (int e = 0; e < 4; e++) {
for (int f = 0; f < 3; f++) {
for (int g = 0; g < 10; g++) {
Console.Write(" " + a[e, f, g]);
}
Console.WriteLine();
}
if (e != 3)
Console.WriteLine("####################");
}
}
}
|
[["+", 8, 196, 0, 1, 0, 213, 63, 214, 205, 22], ["+", 8, 196, 0, 1, 0, 213, 63, 214, 0, 131], ["+", 8, 196, 0, 1, 0, 213, 63, 214, 141, 22], ["+", 8, 196, 0, 1, 0, 213, 3, 4, 0, 24], ["+", 8, 196, 0, 1, 0, 213, 3, 4, 0, 25], ["+", 8, 196, 0, 7, 8, 196, 0, 1, 0, 35]]
| 8
| 214
| 6
|
using System;
namespace ITP1_6_C {
class Program {
static void Main(string[] args) {
int num = int.Parse(Console.ReadLine());
int[] bld11 = new int[10];
int[] bld12 = new int[10];
int[] bld13 = new int[10];
int[] bld21 = new int[10];
int[] bld22 = new int[10];
int[] bld23 = new int[10];
int[] bld31 = new int[10];
int[] bld32 = new int[10];
int[] bld33 = new int[10];
int[] bld41 = new int[10];
int[] bld42 = new int[10];
int[] bld43 = new int[10];
for (int j = 0; j < num; j++) {
string[] input = Console.ReadLine().Split(' ');
int b = int.Parse(input[0]);
int f = int.Parse(input[1]);
int r = int.Parse(input[2]);
int v = int.Parse(input[3]);
switch (b) {
case 1:
switch (f) {
case 1:
bld11[r - 1] += v;
break;
case 2:
bld12[r - 1] += v;
break;
case 3:
bld13[r - 1] += v;
break;
}
break;
case 2:
switch (f) {
case 1:
bld21[r - 1] += v;
break;
case 2:
bld22[r - 1] += v;
break;
case 3:
bld23[r - 1] += v;
break;
}
break;
case 3:
switch (f) {
case 1:
bld31[r - 1] += v;
break;
case 2:
bld32[r - 1] += v;
break;
case 3:
bld33[r - 1] += v;
break;
}
break;
case 4:
switch (f) {
case 1:
bld41[r - 1] += v;
break;
case 2:
bld42[r - 1] += v;
break;
case 3:
bld43[r - 1] += v;
break;
}
break;
}
for (int n1 = 0; n1 < 10; n1++) {
Console.Write(" {0}", bld11[n1]);
}
Console.WriteLine();
for (int n2 = 0; n2 < 10; n2++) {
Console.Write(" {0}", bld12[n2]);
}
Console.WriteLine();
for (int n3 = 0; n3 < 10; n3++) {
Console.Write(" {0}", bld13[n3]);
}
Console.WriteLine();
Console.WriteLine("####################");
for (int n5 = 0; n5 < 10; n5++) {
Console.Write(" {0}", bld21[n5]);
}
Console.WriteLine();
for (int n6 = 0; n6 < 10; n6++) {
Console.Write(" {0}", bld22[n6]);
}
Console.WriteLine();
for (int n7 = 0; n7 < 10; n7++) {
Console.Write(" {0}", bld23[n7]);
}
Console.WriteLine();
Console.WriteLine("####################");
for (int n8 = 0; n8 < 10; n8++) {
Console.Write(" {0}", bld31[n8]);
}
Console.WriteLine();
for (int n9 = 0; n9 < 10; n9++) {
Console.Write(" {0}", bld32[n9]);
}
Console.WriteLine();
for (int n10 = 0; n10 < 10; n10++) {
Console.Write(" {0}", bld33[n10]);
}
Console.WriteLine();
Console.WriteLine("####################");
for (int n11 = 0; n11 < 10; n11++) {
Console.Write(" {0}", bld41[n11]);
}
Console.WriteLine();
for (int n12 = 0; n12 < 10; n12++) {
Console.Write(" {0}", bld42[n12]);
}
Console.WriteLine();
for (int n13 = 0; n13 < 10; n13++) {
Console.Write(" {0}", bld43[n13]);
}
Console.WriteLine();
}
}
}
}
|
using System;
namespace ITP1_6_C {
class Program {
static void Main(string[] args) {
int num = int.Parse(Console.ReadLine());
int[] bld11 = new int[10];
int[] bld12 = new int[10];
int[] bld13 = new int[10];
int[] bld21 = new int[10];
int[] bld22 = new int[10];
int[] bld23 = new int[10];
int[] bld31 = new int[10];
int[] bld32 = new int[10];
int[] bld33 = new int[10];
int[] bld41 = new int[10];
int[] bld42 = new int[10];
int[] bld43 = new int[10];
for (int j = 0; j < num; j++) {
string[] input = Console.ReadLine().Split(' ');
int b = int.Parse(input[0]);
int f = int.Parse(input[1]);
int r = int.Parse(input[2]);
int v = int.Parse(input[3]);
switch (b) {
case 1:
switch (f) {
case 1:
bld11[r - 1] += v;
break;
case 2:
bld12[r - 1] += v;
break;
case 3:
bld13[r - 1] += v;
break;
}
break;
case 2:
switch (f) {
case 1:
bld21[r - 1] += v;
break;
case 2:
bld22[r - 1] += v;
break;
case 3:
bld23[r - 1] += v;
break;
}
break;
case 3:
switch (f) {
case 1:
bld31[r - 1] += v;
break;
case 2:
bld32[r - 1] += v;
break;
case 3:
bld33[r - 1] += v;
break;
}
break;
case 4:
switch (f) {
case 1:
bld41[r - 1] += v;
break;
case 2:
bld42[r - 1] += v;
break;
case 3:
bld43[r - 1] += v;
break;
}
break;
}
}
for (int n1 = 0; n1 < 10; n1++) {
Console.Write(" {0}", bld11[n1]);
}
Console.WriteLine();
for (int n2 = 0; n2 < 10; n2++) {
Console.Write(" {0}", bld12[n2]);
}
Console.WriteLine();
for (int n3 = 0; n3 < 10; n3++) {
Console.Write(" {0}", bld13[n3]);
}
Console.WriteLine();
Console.WriteLine("####################");
for (int n5 = 0; n5 < 10; n5++) {
Console.Write(" {0}", bld21[n5]);
}
Console.WriteLine();
for (int n6 = 0; n6 < 10; n6++) {
Console.Write(" {0}", bld22[n6]);
}
Console.WriteLine();
for (int n7 = 0; n7 < 10; n7++) {
Console.Write(" {0}", bld23[n7]);
}
Console.WriteLine();
Console.WriteLine("####################");
for (int n8 = 0; n8 < 10; n8++) {
Console.Write(" {0}", bld31[n8]);
}
Console.WriteLine();
for (int n9 = 0; n9 < 10; n9++) {
Console.Write(" {0}", bld32[n9]);
}
Console.WriteLine();
for (int n10 = 0; n10 < 10; n10++) {
Console.Write(" {0}", bld33[n10]);
}
Console.WriteLine();
Console.WriteLine("####################");
for (int n11 = 0; n11 < 10; n11++) {
Console.Write(" {0}", bld41[n11]);
}
Console.WriteLine();
for (int n12 = 0; n12 < 10; n12++) {
Console.Write(" {0}", bld42[n12]);
}
Console.WriteLine();
for (int n13 = 0; n13 < 10; n13++) {
Console.Write(" {0}", bld43[n13]);
}
Console.WriteLine();
}
}
}
|
[["+", 0, 195, 8, 196, 0, 7, 8, 196, 0, 46], ["-", 0, 195, 8, 196, 0, 7, 8, 196, 0, 46]]
| 8
| 931
| 2
|
using System;
using System.Text;
class Program {
//--------------------------------------------------
static void Main(string[] args) {
University university = new University();
university.Read();
university.Print();
}
//--------------------------------------------------
public class University {
//--------------------------------------------------
public University() {
for (int i = 0; i < _buildings.Length; ++i) {
_buildings[i] = new Building();
}
}
//--------------------------------------------------
public void Read() {
int n = int.Parse(Console.ReadLine());
for (int i = 0; i < n; ++i) {
string[] strings = Console.ReadLine().Split();
int b = int.Parse(strings[0]) - 1;
int f = int.Parse(strings[1]) - 1;
int r = int.Parse(strings[2]) - 1;
int v = int.Parse(strings[3]);
_buildings[b]._floors[f]._rooms[r] = v;
}
}
//--------------------------------------------------
public void Print() {
StringBuilder builder = new StringBuilder();
_buildings[0].AppendString(ref builder);
for (int i = 1; i < _buildings.Length; ++i) {
builder.AppendLine("####################");
_buildings[i].AppendString(ref builder);
}
Console.Write(builder.ToString());
}
//--------------------------------------------------
private Building[] _buildings = new Building[4];
}
//--------------------------------------------------
public class Building {
//--------------------------------------------------
public Building() {
for (int i = 0; i < _floors.Length; ++i) {
_floors[i] = new Floor();
}
}
//--------------------------------------------------
public void AppendString(ref StringBuilder builder) {
for (int i = 0; i < _floors.Length; ++i) {
_floors[i].AppendString(ref builder);
}
}
//--------------------------------------------------
public Floor[] _floors = new Floor[3];
}
//--------------------------------------------------
public class Floor {
//--------------------------------------------------
public void AppendString(ref StringBuilder builder) {
for (int i = 0; i < _rooms.Length; ++i) {
builder.AppendFormat(" {0}", _rooms[i]);
}
builder.AppendLine();
}
//--------------------------------------------------
public int[] _rooms = new int[10];
}
}
|
using System;
using System.Text;
class Program {
//--------------------------------------------------
static void Main(string[] args) {
University university = new University();
university.Read();
university.Print();
}
//--------------------------------------------------
public class University {
//--------------------------------------------------
public University() {
for (int i = 0; i < _buildings.Length; ++i) {
_buildings[i] = new Building();
}
}
//--------------------------------------------------
public void Read() {
int n = int.Parse(Console.ReadLine());
for (int i = 0; i < n; ++i) {
string[] strings = Console.ReadLine().Split();
int b = int.Parse(strings[0]) - 1;
int f = int.Parse(strings[1]) - 1;
int r = int.Parse(strings[2]) - 1;
int v = int.Parse(strings[3]);
_buildings[b]._floors[f]._rooms[r] += v;
}
}
//--------------------------------------------------
public void Print() {
StringBuilder builder = new StringBuilder();
_buildings[0].AppendString(ref builder);
for (int i = 1; i < _buildings.Length; ++i) {
builder.AppendLine("####################");
_buildings[i].AppendString(ref builder);
}
Console.Write(builder.ToString());
}
//--------------------------------------------------
private Building[] _buildings = new Building[4];
}
//--------------------------------------------------
public class Building {
//--------------------------------------------------
public Building() {
for (int i = 0; i < _floors.Length; ++i) {
_floors[i] = new Floor();
}
}
//--------------------------------------------------
public void AppendString(ref StringBuilder builder) {
for (int i = 0; i < _floors.Length; ++i) {
_floors[i].AppendString(ref builder);
}
}
//--------------------------------------------------
public Floor[] _floors = new Floor[3];
}
//--------------------------------------------------
public class Floor {
//--------------------------------------------------
public void AppendString(ref StringBuilder builder) {
for (int i = 0; i < _rooms.Length; ++i) {
builder.AppendFormat(" {0}", _rooms[i]);
}
builder.AppendLine();
}
//--------------------------------------------------
public int[] _rooms = new int[10];
}
}
|
[["-", 8, 196, 0, 1, 0, 11, 0, 202, 0, 32], ["+", 8, 196, 0, 1, 0, 11, 0, 202, 0, 107]]
| 8
| 464
| 2
|
using System;
class Program {
static void Main() {
int[,,] house = new int[4, 3, 10];
for (int i = 0; i < 4; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 10; k++) {
house[i, j, k] = 0;
}
int n = int.Parse(Console.ReadLine());
for (int i = 0; i < n; i++) {
string[] s = Console.ReadLine().Split(' ');
int b = int.Parse(s[0]) - 1;
int f = int.Parse(s[1]) - 1;
int r = int.Parse(s[2]) - 1;
int v = int.Parse(s[3]);
house[b, f, r] = v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" {0}", house[i, j, k]);
}
Console.WriteLine();
}
if (i != 3) {
Console.Write("####################");
Console.WriteLine();
}
}
}
}
|
using System;
class Program {
static void Main() {
int[,,] house = new int[4, 3, 10];
for (int i = 0; i < 4; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 10; k++) {
house[i, j, k] = 0;
}
int n = int.Parse(Console.ReadLine());
for (int i = 0; i < n; i++) {
string[] s = Console.ReadLine().Split(' ');
int b = int.Parse(s[0]) - 1;
int f = int.Parse(s[1]) - 1;
int r = int.Parse(s[2]) - 1;
int v = int.Parse(s[3]);
house[b, f, r] += v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" {0}", house[i, j, k]);
}
Console.WriteLine();
}
if (i != 3) {
Console.Write("####################");
Console.WriteLine();
}
}
}
}
|
[["-", 8, 196, 0, 1, 0, 11, 0, 202, 0, 32], ["+", 8, 196, 0, 1, 0, 11, 0, 202, 0, 107]]
| 8
| 298
| 2
|
using System;
public class ITP1_6_C {
static void Main() {
int[,,] house = new int[4, 3, 10];
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 0; k++) {
house[i, j, k] = 0;
}
}
}
int c = int.Parse(Console.ReadLine());
int b, f, r, v;
for (int i = 0; i < c; i++) {
string[] data = Console.ReadLine().Split(' ');
b = int.Parse(data[0]);
f = int.Parse(data[0]);
r = int.Parse(data[0]);
v = int.Parse(data[0]);
house[b - 1, f - 1, r - 1] += v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 0; k++) {
Console.Write(" {0}", house[i, j, k]);
}
Console.Write("\n");
}
if (i != 3)
Console.WriteLine("####################");
}
}
}
|
using System;
public class ITP1_6_C {
static void Main() {
int[,,] house = new int[4, 3, 10];
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
house[i, j, k] = 0;
}
}
}
int c = int.Parse(Console.ReadLine());
int b, f, r, v;
for (int i = 0; i < c; i++) {
string[] data = Console.ReadLine().Split(' ');
b = int.Parse(data[0]);
f = int.Parse(data[1]);
r = int.Parse(data[2]);
v = int.Parse(data[3]);
house[b - 1, f - 1, r - 1] += v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" {0}", house[i, j, k]);
}
Console.Write("\n");
}
if (i != 3)
Console.WriteLine("####################");
}
}
}
|
[["-", 0, 7, 8, 196, 0, 7, 15, 16, 12, 203], ["+", 0, 7, 8, 196, 0, 7, 15, 16, 12, 203], ["-", 0, 28, 0, 204, 206, 207, 0, 28, 0, 203], ["+", 0, 28, 0, 204, 206, 207, 0, 28, 0, 203]]
| 8
| 303
| 10
|
using System;
namespace aoj6c {
class Program {
static void Main(string[] args) {
/*b?£?f??????r???????????¨?±????v???*/
int[,,] member =
new int[5, 4, 11]; // 4?£????3????????????10??¨?±? [0]????????¨?????????
int n = int.Parse(Console.ReadLine());
for (int i = 1; i <= n; i++) {
string[] data = (Console.ReadLine()).Split(' ');
int b = int.Parse(data[0]);
int f = int.Parse(data[1]);
int r = int.Parse(data[2]);
int v = int.Parse(data[3]);
member[b, f, r] += v;
}
for (int l = 1; l <= 4; l++) {
for (int j = 1; j <= 3; j++) {
for (int k = 1; k <= 10; k++) {
Console.Write(member[l, j, k]);
}
Console.WriteLine();
}
if (l != 4) {
Console.WriteLine("####################");
}
}
}
}
}
|
using System;
namespace aoj6c {
class Program {
static void Main(string[] args) {
/*b?£?f??????r???????????¨?±????v???*/
int[,,] member =
new int[5, 4, 11]; // 4?£????3????????????10??¨?±? [0]????????¨?????????
int n = int.Parse(Console.ReadLine());
for (int i = 1; i <= n; i++) {
string[] data = (Console.ReadLine()).Split(' ');
int b = int.Parse(data[0]);
int f = int.Parse(data[1]);
int r = int.Parse(data[2]);
int v = int.Parse(data[3]);
member[b, f, r] += v;
}
for (int l = 1; l <= 4; l++) {
for (int j = 1; j <= 3; j++) {
for (int k = 1; k <= 10; k++) {
Console.Write(" " + member[l, j, k]);
}
Console.WriteLine();
}
if (l != 4) {
Console.WriteLine("####################");
}
}
}
}
}
|
[["+", 3, 4, 0, 28, 0, 16, 31, 5, 0, 62], ["+", 3, 4, 0, 28, 0, 16, 31, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 16, 17, 72]]
| 8
| 239
| 4
|
using System;
using System.Linq;
using System.Text;
namespace ITP1_6_C {
class Program {
static Building[] Buildings;
static void Main(string[] args) {
Buildings = new Building[4];
for (int i = 0; i < Buildings.Length; i++)
Buildings[i] = new Building();
int count = Convert.ToInt32(Console.ReadLine());
for (int i = 0; i < count; i++) {
var input = Console.ReadLine().Split(' ');
int buildingNum = Convert.ToInt32(input[0]) - 1;
int floorNum = Convert.ToInt32(input[1]) - 1;
int roomNum = Convert.ToInt32(input[2]) - 1;
int peopleNum = Convert.ToInt32(input[3]);
Buildings[buildingNum][floorNum][roomNum] = peopleNum;
}
for (int i = 0; i < Buildings.Length; i++) {
Console.WriteLine(Buildings[i].ToString());
if (i < Buildings.Length - 1) {
Console.WriteLine("####################");
}
}
}
}
public class Building {
public int FloorCount { get; protected set; }
public Floor this[int index] {
get { return Floors[index]; }
set { Floors[index] = value; }
}
protected Floor[] Floors { get; set; }
public Building(int floorCount = 3) {
FloorCount = floorCount;
Floors = new Floor[FloorCount];
for (int i = 0; i < FloorCount; i++)
Floors[i] = new Floor();
}
public override string ToString() {
var builder = new StringBuilder();
for (int i = 0; i < FloorCount; i++) {
builder.AppendLine(Floors[i].ToString());
}
return builder.ToString().TrimEnd('\r', '\n');
}
}
public class Floor {
public int RoomCount { get; protected set; }
public int this[int index] {
get { return Rooms[index]; }
set { Rooms[index] = value; }
}
protected int[] Rooms { get; set; }
public Floor(int roomCount = 10) {
RoomCount = roomCount;
Rooms = new int[RoomCount];
}
public override string ToString() {
return " " + string.Join(" ", Rooms.Select(e => e.ToString()).ToArray());
}
}
}
|
using System;
using System.Linq;
using System.Text;
namespace ITP1_6_C {
class Program {
static Building[] Buildings;
static void Main(string[] args) {
Buildings = new Building[4];
for (int i = 0; i < Buildings.Length; i++)
Buildings[i] = new Building();
int count = Convert.ToInt32(Console.ReadLine());
for (int i = 0; i < count; i++) {
var input = Console.ReadLine().Split(' ');
int buildingNum = Convert.ToInt32(input[0]) - 1;
int floorNum = Convert.ToInt32(input[1]) - 1;
int roomNum = Convert.ToInt32(input[2]) - 1;
int peopleNum = Convert.ToInt32(input[3]);
Buildings[buildingNum][floorNum][roomNum] += peopleNum;
}
for (int i = 0; i < Buildings.Length; i++) {
Console.WriteLine(Buildings[i].ToString());
if (i < Buildings.Length - 1) {
Console.WriteLine("####################");
}
}
}
}
public class Building {
public int FloorCount { get; protected set; }
public Floor this[int index] {
get { return Floors[index]; }
set { Floors[index] = value; }
}
protected Floor[] Floors { get; set; }
public Building(int floorCount = 3) {
FloorCount = floorCount;
Floors = new Floor[FloorCount];
for (int i = 0; i < FloorCount; i++)
Floors[i] = new Floor();
}
public override string ToString() {
var builder = new StringBuilder();
for (int i = 0; i < FloorCount; i++) {
builder.AppendLine(Floors[i].ToString());
}
return builder.ToString().TrimEnd('\r', '\n');
}
}
public class Floor {
public int RoomCount { get; protected set; }
public int this[int index] {
get { return Rooms[index]; }
set { Rooms[index] = value; }
}
protected int[] Rooms { get; set; }
public Floor(int roomCount = 10) {
RoomCount = roomCount;
Rooms = new int[RoomCount];
}
public override string ToString() {
return " " + string.Join(" ", Rooms.Select(e => e.ToString()).ToArray());
}
}
}
|
[["-", 8, 196, 0, 1, 0, 11, 0, 202, 0, 32], ["+", 8, 196, 0, 1, 0, 11, 0, 202, 0, 107]]
| 8
| 521
| 2
|
using System;
using System.Collections.Generic;
class Program {
static void Main() {
int[,,] Kosha = new int[4, 3, 10];
int count = int.Parse(Console.ReadLine());
for (int i = 0; i < count; i++) {
string[] str = Console.ReadLine().Split(' ');
int number = int.Parse(str[0]);
int floor = int.Parse(str[1]);
int room = int.Parse(str[2]);
int ppl = int.Parse(str[3]);
Kosha[number - 1, floor - 1, room - 1] = ppl;
}
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" {0}", Kosha[i, j, k]);
}
Console.WriteLine();
}
Console.WriteLine("####################");
}
for (int i = 3; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" {0}", Kosha[i, j, k]);
}
Console.WriteLine();
}
}
}
}
|
using System;
using System.Collections.Generic;
class Program {
static void Main() {
int[,,] Kosha = new int[4, 3, 10];
int count = int.Parse(Console.ReadLine());
for (int i = 0; i < count; i++) {
string[] str = Console.ReadLine().Split(' ');
int number = int.Parse(str[0]);
int floor = int.Parse(str[1]);
int room = int.Parse(str[2]);
int ppl = int.Parse(str[3]);
Kosha[number - 1, floor - 1, room - 1] += ppl;
}
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" {0}", Kosha[i, j, k]);
}
Console.WriteLine();
}
Console.WriteLine("####################");
}
for (int i = 3; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" {0}", Kosha[i, j, k]);
}
Console.WriteLine();
}
}
}
}
|
[["-", 8, 196, 0, 1, 0, 11, 0, 202, 0, 32], ["+", 8, 196, 0, 1, 0, 11, 0, 202, 0, 107]]
| 8
| 308
| 2
|
using System;
using System.Linq;
namespace Array {
class Official_House {
static void Main(string[] args) {
var n = int.Parse(Console.ReadLine());
var data = new int[4, 3, 10];
for (int i = 0; i < n; i++) {
var array =
Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
data[array[0] - 1, array[1] - 1, array[2] - 1] += array[3];
}
for (int i = 0; i < data.GetLength(0); i++) {
for (int j = 0; j < data.GetLength(1); j++) {
for (int k = 0; k < data.GetLength(2); k++) {
Console.Write(data[i, j, k]);
}
Console.WriteLine();
}
if (i != data.GetLength(0) - 1)
Console.WriteLine("####################");
}
}
}
}
|
using System;
using System.Linq;
namespace Array {
class Official_House {
static void Main(string[] args) {
var n = int.Parse(Console.ReadLine());
var data = new int[4, 3, 10];
for (int i = 0; i < n; i++) {
var array =
Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
data[array[0] - 1, array[1] - 1, array[2] - 1] += array[3];
}
for (int i = 0; i < data.GetLength(0); i++) {
for (int j = 0; j < data.GetLength(1); j++) {
for (int k = 0; k < data.GetLength(2); k++) {
Console.Write(" " + data[i, j, k]);
}
Console.WriteLine();
}
if (i != data.GetLength(0) - 1)
Console.WriteLine("####################");
}
}
}
}
|
[["+", 3, 4, 0, 28, 0, 16, 31, 5, 0, 62], ["+", 3, 4, 0, 28, 0, 16, 31, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 16, 17, 72]]
| 8
| 236
| 4
|
using System;
public class OfficialHouse {
// 4?£?????????¬???????????\?±?????????±?????\????????????
static void Main(string[] args) {
/*---??£?¨???¨---*/
int i;
int buildIndex;
int floorIndex;
int roomIndex;
int count;
//???????????¬?????§3???????????????????????¢????????¨?±???¨??????
int[,,] officialHouse = new int[4, 3, 10];
int[] houseData = new int[4];
string[] buffer;
/*---??£?¨???¨---*/
/*??\??????[b, f, r, v](b?£? f??? r???????????¨?±?
* v???(-???????????¨??????))???????????????*/
count = int.Parse(Console.ReadLine());
for (i = 0; i < count; i++) {
buffer = Console.ReadLine().Split(' ');
// houseData = buffer.Select(s => int.Parse(s)).ToArray();
houseData[0] = int.Parse(buffer[0]);
houseData[1] = int.Parse(buffer[1]);
houseData[2] = int.Parse(buffer[2]);
houseData[3] = int.Parse(buffer[3]);
officialHouse[houseData[0] - 1, houseData[1] - 1, houseData[2] - 1] +=
houseData[3];
}
/*?????±?????¨???*/
for (buildIndex = 0; buildIndex < 4; buildIndex++) {
for (floorIndex = 0; floorIndex < 3; floorIndex++) {
for (roomIndex = 0; roomIndex < 10; roomIndex++) {
Console.Write(" {0}",
officialHouse[buildIndex, floorIndex, roomIndex]);
}
Console.Write("\n");
}
//?£????????????????????????????????????\????????????
Console.WriteLine("####################");
}
}
}
|
using System;
public class OfficialHouse {
// 4?£?????????¬???????????\?±?????????±?????\????????????
static void Main(string[] args) {
/*---??£?¨???¨---*/
int i;
int buildIndex;
int floorIndex;
int roomIndex;
int count;
//???????????¬?????§3???????????????????????¢????????¨?±???¨??????
int[,,] officialHouse = new int[4, 3, 10];
int[] houseData = new int[4];
string[] buffer;
/*---??£?¨???¨---*/
/*??\??????[b, f, r, v](b?£? f??? r???????????¨?±?
* v???(-???????????¨??????))???????????????*/
count = int.Parse(Console.ReadLine());
for (i = 0; i < count; i++) {
buffer = Console.ReadLine().Split(' ');
// houseData = buffer.Select(s => int.Parse(s)).ToArray();
houseData[0] = int.Parse(buffer[0]);
houseData[1] = int.Parse(buffer[1]);
houseData[2] = int.Parse(buffer[2]);
houseData[3] = int.Parse(buffer[3]);
officialHouse[houseData[0] - 1, houseData[1] - 1, houseData[2] - 1] +=
houseData[3];
}
/*?????±?????¨???*/
for (buildIndex = 0; buildIndex < 4; buildIndex++) {
for (floorIndex = 0; floorIndex < 3; floorIndex++) {
for (roomIndex = 0; roomIndex < 10; roomIndex++) {
Console.Write(" {0}",
officialHouse[buildIndex, floorIndex, roomIndex]);
}
Console.Write("\n");
}
//?£????????????????????????????????????\????????????
if (buildIndex != 3)
Console.WriteLine("####################");
}
}
}
|
[["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 24], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 31, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 17, 79], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 12, 203], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 25]]
| 8
| 288
| 6
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
class Program {
static void Main(string[] args) {
int n = int.Parse(Console.ReadLine());
int[,,] room = new int[4, 3, 10];
for (int i = 0; i < n; i++) {
string[] s = Console.ReadLine().Split(' ');
room[int.Parse(s[0]) - 1, int.Parse(s[1]) - 1, int.Parse(s[2]) - 1] +=
int.Parse(s[3]);
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(room[i, j, k]);
}
Console.WriteLine();
}
if (i < 3)
Console.WriteLine("####################");
}
return;
// Console.WriteLine("");
}
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
class Program {
static void Main(string[] args) {
int n = int.Parse(Console.ReadLine());
int[,,] room = new int[4, 3, 10];
for (int i = 0; i < n; i++) {
string[] s = Console.ReadLine().Split(' ');
room[int.Parse(s[0]) - 1, int.Parse(s[1]) - 1, int.Parse(s[2]) - 1] +=
int.Parse(s[3]);
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
Console.Write(" {0}", room[i, j, k]);
}
Console.WriteLine();
}
if (i < 3)
Console.WriteLine("####################");
}
// Console.WriteLine("");
}
}
|
[["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 62], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 8, 196, 0, 1, 0, 213, 3, 4, 0, 21], ["-", 8, 201, 0, 195, 8, 196, 0, 37, 0, 38], ["-", 8, 201, 0, 195, 8, 196, 0, 37, 0, 35]]
| 8
| 250
| 6
|
using System;
using System.Linq;
class Program {
static void Main() {
int n = int.Parse(Console.ReadLine());
string[] s = null;
int b, f, r, v;
int[][,] rr = new int [4][,] { new int[3, 10], new int[3, 10],
new int[3, 10], new int[3, 10] };
for (int i = 0; i < n; i++) {
s = Console.ReadLine().Split(' ');
b = int.Parse(s[0]);
f = int.Parse(s[1]);
r = int.Parse(s[2]);
v = int.Parse(s[3]);
rr[(b - 1)][(f - 1), (r - 1)] = v;
}
string ret;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
ret = "";
for (int k = 0; k < 10; k++) {
ret = ret + " " + rr[i][j, k].ToString();
}
Console.WriteLine(ret);
}
if (i != 3)
Console.WriteLine(new String('#', 20));
}
}
}
|
using System;
using System.Linq;
class Program {
static void Main() {
int n = int.Parse(Console.ReadLine());
string[] s = null;
int b, f, r, v;
int[][,] rr = new int [4][,] { new int[3, 10], new int[3, 10],
new int[3, 10], new int[3, 10] };
for (int i = 0; i < n; i++) {
s = Console.ReadLine().Split(' ');
b = int.Parse(s[0]);
f = int.Parse(s[1]);
r = int.Parse(s[2]);
v = int.Parse(s[3]);
rr[(b - 1)][(f - 1), (r - 1)] += v;
}
string ret;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
ret = "";
for (int k = 0; k < 10; k++) {
ret = ret + " " + rr[i][j, k].ToString();
}
Console.WriteLine(ret);
}
if (i != 3)
Console.WriteLine(new String('#', 20));
}
}
}
|
[["-", 8, 196, 0, 1, 0, 11, 0, 202, 0, 32], ["+", 8, 196, 0, 1, 0, 11, 0, 202, 0, 107]]
| 8
| 308
| 2
|
using System;
using System.Linq;
namespace ConsoleApp_ITP1_6_C {
class Program {
static void Main(string[] args) {
var n = Int32.Parse(Console.ReadLine());
int[,,] output = new[,,] { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } };
for (int i = 1; i <= n; i++) {
int[] input =
Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
var b = input[0];
var f = input[1];
var r = input[2];
var v = input[3];
output[b - 1, f - 1, r] += v;
}
for (int z = 0; z < 4; z++) {
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 10; x++) {
Console.Write(" {0}", output[z, y, x]);
}
Console.WriteLine();
}
if (z <= 2)
Console.WriteLine("####################");
}
}
}
}
|
using System;
using System.Linq;
namespace ConsoleApp_ITP1_6_C {
class Program {
static void Main(string[] args) {
var n = Int32.Parse(Console.ReadLine());
int[,,] output = new[,,] { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } };
for (int i = 1; i <= n; i++) {
int[] input =
Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
var b = input[0];
var f = input[1];
var r = input[2];
var v = input[3];
output[b - 1, f - 1, r - 1] += v;
}
for (int z = 0; z < 4; z++) {
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 10; x++) {
Console.Write(" {0}", output[z, y, x]);
}
Console.WriteLine();
}
if (z <= 2)
Console.WriteLine("####################");
}
}
}
}
|
[["+", 31, 204, 206, 207, 0, 28, 0, 16, 17, 33], ["+", 31, 204, 206, 207, 0, 28, 0, 16, 12, 203]]
| 8
| 511
| 2
|
using System;
class Program {
static void Main(string[] args) {
int[,,] array = new int[4, 3, 10];
int n, b, f, r, v;
//配列初期化
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
array[i, j, k] = 0;
}
}
}
//入居件数受け取り
string str1 = Console.ReadLine();
n = int.Parse(str1);
//入居詳細受け取り、入居人数を配列に追加
for (int h = 0; h < n; h++) {
string[] str2 = Console.ReadLine().Split(' ');
b = int.Parse(str2[0]);
f = int.Parse(str2[1]);
r = int.Parse(str2[2]);
v = int.Parse(str2[3]);
switch (b) {
case 1:
array[b - 1, f - 1, r - 1] = v;
break;
case 2:
array[b - 1, f - 1, r - 1] = v;
break;
case 3:
array[b - 1, f - 1, r - 1] = v;
break;
case 4:
array[b - 1, f - 1, r - 1] = v;
break;
}
}
//入居人数出力
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
if (array[i, j, k] == 0) {
Console.Write(" 0");
} else if (array[i, j, k] != 0)
Console.Write(" " + array[i, j, k]);
}
Console.WriteLine("");
}
if (i < 3) {
Console.WriteLine("####################");
} else {
break;
}
}
}
}
|
using System;
class Program {
static void Main(string[] args) {
int[,,] array = new int[4, 3, 10];
int n, b, f, r, v;
//配列初期化
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
array[i, j, k] = 0;
}
}
}
//入居件数受け取り
string str1 = Console.ReadLine();
n = int.Parse(str1);
//入居詳細受け取り、入居人数を配列に追加
for (int h = 0; h < n; h++) {
string[] str2 = Console.ReadLine().Split(' ');
b = int.Parse(str2[0]);
f = int.Parse(str2[1]);
r = int.Parse(str2[2]);
v = int.Parse(str2[3]);
switch (b) {
case 1:
array[b - 1, f - 1, r - 1] += v;
break;
case 2:
array[b - 1, f - 1, r - 1] += v;
break;
case 3:
array[b - 1, f - 1, r - 1] += v;
break;
case 4:
array[b - 1, f - 1, r - 1] += v;
break;
}
}
//入居人数出力
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
if (array[i, j, k] == 0) {
Console.Write(" 0");
} else if (array[i, j, k] != 0)
Console.Write(" " + array[i, j, k]);
}
Console.WriteLine("");
}
if (i < 3) {
Console.WriteLine("####################");
} else {
break;
}
}
}
}
|
[["-", 0, 239, 0, 1, 0, 11, 0, 202, 0, 32], ["+", 0, 239, 0, 1, 0, 11, 0, 202, 0, 107]]
| 8
| 437
| 8
|
using System;
class Program {
static void Main() {
int[,,] hause = new int[4, 3, 10];
int inputnum = int.Parse(Console.ReadLine());
for (int i = 0; i < inputnum; i++) {
int[] line = TypeConverter.arrayStrToInt(Console.ReadLine().Split(' '));
hause[line[0], line[1], line[2]] += line[3];
}
for (int b = 0; b < 4; b++) {
for (int f = 0; f < 3; f++) {
for (int r = 0; r < 10; r++) {
Console.Write(" " + hause[b, f, r].ToString());
}
Console.Write("\n");
}
if (b < 3)
Console.Write("####################\n");
}
}
}
class TypeConverter {
static public int[] arrayStrToInt(string[] str) {
return Array.ConvertAll<string, int>(
str, delegate(string value) { return int.Parse(value); });
}
static public string[] arrayIntToStr(int[] x) {
return Array.ConvertAll<int, string>(
x, delegate(int value) { return value.ToString(); });
}
}
|
using System;
class Program {
static void Main() {
int[,,] hause = new int[4, 3, 10];
int inputnum = int.Parse(Console.ReadLine());
for (int i = 0; i < inputnum; i++) {
int[] line = TypeConverter.arrayStrToInt(Console.ReadLine().Split(' '));
hause[line[0] - 1, line[1] - 1, line[2] - 1] += line[3];
}
for (int b = 0; b < 4; b++) {
for (int f = 0; f < 3; f++) {
for (int r = 0; r < 10; r++) {
Console.Write(" " + hause[b, f, r].ToString());
}
Console.Write("\n");
}
if (b < 3)
Console.Write("####################\n");
}
}
}
class TypeConverter {
static public int[] arrayStrToInt(string[] str) {
return Array.ConvertAll<string, int>(
str, delegate(string value) { return int.Parse(value); });
}
static public string[] arrayIntToStr(int[] x) {
return Array.ConvertAll<int, string>(
x, delegate(int value) { return value.ToString(); });
}
}
|
[["+", 31, 204, 206, 207, 0, 28, 0, 16, 17, 33], ["+", 31, 204, 206, 207, 0, 28, 0, 16, 12, 203]]
| 8
| 291
| 6
|
using System;
class program {
public static void Main() {
// row column
var strs = Console.ReadLine().Split(' ');
var row = int.Parse(strs[0]);
var column = int.Parse(strs[1]);
int[,] A = new int[row, column];
int[] b = new int[column];
for (int i = 0; i < row; i++) {
strs = Console.ReadLine().Split(' ');
for (int j = 0; j < column; j++) {
A[i, j] = int.Parse(strs[j]);
}
}
for (int k = 0; k < column; k++) {
b[k] = int.Parse(Console.ReadLine());
}
for (int l = 0; l < row; l++) {
int x = 0;
for (int m = 0; m < row; m++) {
x += A[l, m] * b[m];
}
Console.WriteLine(x);
}
}
}
|
using System;
class program {
public static void Main() {
// row column
var strs = Console.ReadLine().Split(' ');
var row = int.Parse(strs[0]);
var column = int.Parse(strs[1]);
int[,] A = new int[row, column];
int[] b = new int[column];
for (int i = 0; i < row; i++) {
strs = Console.ReadLine().Split(' ');
for (int j = 0; j < column; j++) {
A[i, j] = int.Parse(strs[j]);
}
}
for (int k = 0; k < column; k++) {
b[k] = int.Parse(Console.ReadLine());
}
for (int l = 0; l < row; l++) {
int x = 0;
for (int m = 0; m < column; m++) {
x += (A[l, m] * b[m]);
}
Console.WriteLine(x);
}
}
}
|
[["-", 0, 7, 8, 196, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 196, 0, 7, 15, 16, 12, 22], ["+", 8, 196, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 8, 196, 0, 1, 0, 11, 12, 23, 0, 25]]
| 8
| 237
| 4
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Matrix_Vector_Multiplication {
class Program {
static void Main(string[] args) {
string line = Console.ReadLine();
string[] strs = line.Split(' ');
int n = int.Parse(strs[0]);
int m = int.Parse(strs[1]);
Vector vectorA = new Vector(n, m);
for (int i = 0; i < n; i++) {
line = Console.ReadLine();
strs = line.Split(' ');
for (int j = 0; j < m; j++) {
int value = int.Parse(strs[j]);
vectorA.SetValue(i, j, value);
}
}
Vector vectorB = new Vector(m, 1);
for (int i = 0; i < m; i++) {
int value = int.Parse(Console.ReadLine());
vectorB.SetValue(0, i, value);
}
Vector answer = vectorA.Mul(vectorB);
for (int i = 0; i < n; i++) {
Console.WriteLine(answer.GetValue(i, 0));
}
}
}
public class Vector {
private List<List<int>> vector;
private int row;
private int col;
/// <summary>
/// n行m列の行列を構築する
/// 全要素は0となる
/// </summary>
/// <param name="row">行数</param>
/// <param name="col">列数</param>
public Vector(int row, int col) {
vector = new List<List<int>>();
this.row = row;
this.col = col;
for (int i = 0; i < row; i++) {
vector.Add(new List<int>());
for (int j = 0; j < col; j++) {
vector[i].Add(0);
}
}
}
public int GetRow() { return row; }
public int GetCol() { return col; }
public int GetValue(int row, int col) { return vector[row][col]; }
public void SetValue(int row, int col, int value) {
vector[row][col] = value;
}
public Vector Mul(Vector rValue) {
Vector answer = new Vector(row, rValue.GetCol());
for (int i = 0; i < row; i++) {
int sum = 0;
for (int j = 0; j < rValue.GetRow(); j++) {
sum += GetValue(i, j) * rValue.GetValue(j, 0);
}
answer.SetValue(i, 0, sum);
}
return answer;
}
public string Show() {
string str = "";
for (int i = 0; i < GetRow(); i++) {
for (int j = 0; j < GetCol(); j++) {
str += GetValue(i, j) + " ";
}
str += "\n";
}
return str;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Matrix_Vector_Multiplication {
class Program {
static void Main(string[] args) {
string line = Console.ReadLine();
string[] strs = line.Split(' ');
int n = int.Parse(strs[0]);
int m = int.Parse(strs[1]);
Vector vectorA = new Vector(n, m);
for (int i = 0; i < n; i++) {
line = Console.ReadLine();
strs = line.Split(' ');
for (int j = 0; j < m; j++) {
int value = int.Parse(strs[j]);
vectorA.SetValue(i, j, value);
}
}
Vector vectorB = new Vector(m, 1);
for (int i = 0; i < m; i++) {
int value = int.Parse(Console.ReadLine());
vectorB.SetValue(i, 0, value);
}
Vector answer = vectorA.Mul(vectorB);
for (int i = 0; i < n; i++) {
Console.WriteLine(answer.GetValue(i, 0));
}
}
}
public class Vector {
private List<List<int>> vector;
private int row;
private int col;
/// <summary>
/// n行m列の行列を構築する
/// 全要素は0となる
/// </summary>
/// <param name="row">行数</param>
/// <param name="col">列数</param>
public Vector(int row, int col) {
vector = new List<List<int>>();
this.row = row;
this.col = col;
for (int i = 0; i < row; i++) {
vector.Add(new List<int>());
for (int j = 0; j < col; j++) {
vector[i].Add(0);
}
}
}
public int GetRow() { return row; }
public int GetCol() { return col; }
public int GetValue(int row, int col) { return vector[row][col]; }
public void SetValue(int row, int col, int value) {
vector[row][col] = value;
}
public Vector Mul(Vector rValue) {
Vector answer = new Vector(row, rValue.GetCol());
for (int i = 0; i < row; i++) {
int sum = 0;
for (int j = 0; j < rValue.GetRow(); j++) {
sum += GetValue(i, j) * rValue.GetValue(j, 0);
}
answer.SetValue(i, 0, sum);
}
return answer;
}
public string Show() {
string str = "";
for (int i = 0; i < GetRow(); i++) {
for (int j = 0; j < GetCol(); j++) {
str += GetValue(i, j) + " ";
}
str += "\n";
}
return str;
}
}
}
|
[["-", 0, 1, 0, 213, 3, 4, 0, 28, 0, 203], ["-", 8, 196, 0, 1, 0, 213, 3, 4, 0, 21], ["+", 8, 196, 0, 1, 0, 213, 3, 4, 0, 21], ["+", 0, 1, 0, 213, 3, 4, 0, 28, 0, 203]]
| 8
| 620
| 4
|
using System;
using System.Linq;
namespace Test {
class MainClass {
public static void Main(string[] args) {
while (true) {
var inputs = Console.ReadLine().Split(' ');
var m = int.Parse(inputs[0]);
var f = int.Parse(inputs[1]);
var r = int.Parse(inputs[2]);
if ((m == -1) && (f == -1) && (r == -1))
return;
var sum = m + f;
var result = "";
if ((m == -1) || (f == -1) || (sum < 30)) {
result = "F";
} else if (80 <= sum) {
result = "A";
} else if ((65 <= sum) && (sum < 80)) {
result = "C";
} else if ((50 <= sum) && (sum < 65)) {
result = "C";
} else if ((30 <= sum) && (sum < 50)) {
result = (r >= 50) ? "C" : "D";
}
Console.WriteLine(result);
}
}
}
}
|
using System;
using System.Linq;
namespace Test {
class MainClass {
public static void Main(string[] args) {
while (true) {
var inputs = Console.ReadLine().Split(' ');
var m = int.Parse(inputs[0]);
var f = int.Parse(inputs[1]);
var r = int.Parse(inputs[2]);
if ((m == -1) && (f == -1) && (r == -1))
return;
var sum = m + f;
var result = "";
if ((m == -1) || (f == -1) || (sum < 30)) {
result = "F";
} else if (80 <= sum) {
result = "A";
} else if ((65 <= sum) && (sum < 80)) {
result = "B";
} else if ((50 <= sum) && (sum < 65)) {
result = "C";
} else if ((30 <= sum) && (sum < 50)) {
result = (r >= 50) ? "C" : "D";
}
Console.WriteLine(result);
}
}
}
}
|
[["-", 64, 196, 0, 1, 0, 11, 12, 5, 0, 222], ["+", 64, 196, 0, 1, 0, 11, 12, 5, 0, 222]]
| 8
| 258
| 2
|
using System;
using System.Collections.Generic;
class program {
public static void Main() {
List<char> rlist = new List<char>();
while (true) {
var strs = Console.ReadLine().Split(' ');
var m = int.Parse(strs[0]);
var f = int.Parse(strs[1]);
var r = int.Parse(strs[2]);
if (m + f + r == -3)
break;
if (m < 0 || f < 0) {
rlist.Add('F');
} else if (m + f >= 80) {
rlist.Add('A');
} else if (m + f >= 65) {
rlist.Add('B');
} else if (m + f >= 50) {
rlist.Add('C');
} else if (r >= 50) {
rlist.Add('C');
} else if (m + r >= 30) {
rlist.Add('D');
} else {
rlist.Add('F');
}
}
foreach (var rank in rlist) {
Console.WriteLine(rank);
}
}
}
|
using System;
using System.Collections.Generic;
class program {
public static void Main() {
List<char> rlist = new List<char>();
while (true) {
var strs = Console.ReadLine().Split(' ');
var m = int.Parse(strs[0]);
var f = int.Parse(strs[1]);
var r = int.Parse(strs[2]);
if (m + f + r == -3)
break;
if (m < 0 || f < 0) {
rlist.Add('F');
} else if (m + f >= 80) {
rlist.Add('A');
} else if (m + f >= 65) {
rlist.Add('B');
} else if (m + f >= 50) {
rlist.Add('C');
} else if (r >= 50) {
rlist.Add('C');
} else if (m + f >= 30) {
rlist.Add('D');
} else {
rlist.Add('F');
}
}
foreach (var rank in rlist) {
Console.WriteLine(rank);
}
}
}
|
[["-", 75, 57, 75, 57, 15, 16, 31, 16, 12, 22], ["+", 75, 57, 75, 57, 15, 16, 31, 16, 12, 22]]
| 8
| 257
| 2
|
using System;
class Program {
static void Main() {
string D1;
while ((D1 = Console.ReadLine()) != "-1 -1 -1") {
string[] D2 = D1.Split(' ');
int m = int.Parse(D2[0]), f = int.Parse(D2[1]), r = int.Parse(D2[2]);
if (m == -1 || f == -1 || m + f < 30) {
Console.WriteLine("F");
}
if (m + f >= 80) {
Console.WriteLine("A");
}
if (m + f >= 65 && m + f < 80) {
Console.WriteLine("B");
}
if (m + f >= 50 && m + f < 65) {
Console.WriteLine("C");
}
if (m + f >= 30 && m + f < 50) {
if (r >= 50) {
Console.WriteLine("C");
} else {
Console.WriteLine("D");
}
}
}
}
}
|
using System;
class Program {
static void Main() {
string D1;
while ((D1 = Console.ReadLine()) != "-1 -1 -1") {
string[] D2 = D1.Split(' ');
int m = int.Parse(D2[0]), f = int.Parse(D2[1]), r = int.Parse(D2[2]);
if (m == -1 || f == -1 || m + f < 30) {
Console.WriteLine("F");
} else {
if (m + f >= 80) {
Console.WriteLine("A");
}
if (m + f >= 65 && m + f < 80) {
Console.WriteLine("B");
}
if (m + f >= 50 && m + f < 65) {
Console.WriteLine("C");
}
if (m + f >= 30 && m + f < 50) {
if (r >= 50) {
Console.WriteLine("C");
} else {
Console.WriteLine("D");
}
}
}
}
}
}
|
[["+", 8, 196, 0, 52, 8, 196, 0, 57, 0, 95], ["+", 0, 52, 8, 196, 0, 57, 75, 196, 0, 45], ["+", 0, 57, 64, 196, 0, 57, 75, 196, 0, 46]]
| 8
| 229
| 3
|
using System;
using System.Collections.Generic;
using System.Collections;
namespace ConsoleApplication21 {
class Program {
static void Main(string[] args) {
ArrayList T = new ArrayList();
for (int i = 0; i < i + 1; i++) {
String[] input = Console.ReadLine().Split(' ');
int m = int.Parse(input[0]);
int f = int.Parse(input[1]);
int r = int.Parse(input[2]);
if (m == -1 && f == -1 && r == -1)
break;
else if (m == -1 && f == -1 || r != -1)
T.Add("F");
else {
int test = m + f;
if (80 <= test)
T.Add("A");
else if (65 <= test && test < 80)
T.Add("B");
else if (50 <= test && test < 65)
T.Add("C");
else if (30 <= test && test < 50) {
if (50 <= r)
T.Add("C");
else if (r < 50)
T.Add("D");
} else if (test < 30)
T.Add("F");
}
Console.WriteLine(T[i]);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Collections;
namespace ConsoleApplication21 {
class Program {
static void Main(string[] args) {
ArrayList T = new ArrayList();
for (int i = 0; i < i + 1; i++) {
String[] input = Console.ReadLine().Split(' ');
int m = int.Parse(input[0]);
int f = int.Parse(input[1]);
int r = int.Parse(input[2]);
if (m == -1 && f == -1 && r == -1)
break;
else if (m == -1 || f == -1)
T.Add("F");
else {
int test = m + f;
if (80 <= test)
T.Add("A");
else if (65 <= test && test < 80)
T.Add("B");
else if (50 <= test && test < 65)
T.Add("C");
else if (30 <= test && test < 50) {
if (50 <= r)
T.Add("C");
else if (r < 50)
T.Add("D");
} else if (test < 30)
T.Add("F");
}
Console.WriteLine(T[i]);
}
}
}
}
|
[["-", 0, 57, 75, 57, 15, 16, 31, 16, 17, 98], ["+", 8, 196, 0, 57, 75, 57, 15, 16, 17, 106], ["-", 15, 16, 31, 16, 12, 16, 12, 241, 0, 33], ["-", 15, 16, 31, 16, 12, 16, 12, 241, 0, 203], ["-", 8, 196, 0, 57, 75, 57, 15, 16, 17, 106], ["-", 0, 57, 75, 57, 15, 16, 12, 16, 31, 22], ["-", 0, 57, 75, 57, 15, 16, 12, 16, 17, 79]]
| 8
| 298
| 7
|
using System;
class Program {
static void Main(string[] args) {
Input CInput = new Input();
// EasyTask CEasyTask = new EasyTask();
// int input = 0;
// int[] input = new int[(int)Input.Define.MAX_ArraySize];
// int[,] input = new int[(int)Input.Define.MAX_ArraySize,
// (int)Input.Define.ArraySize2d]; int num = 0; input = CInput.Line1_int();
// input = CInput.Multiline_int(' ', 2, ref num);
int[,] input =
new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
// int input3_count = 0;
int cnt = 0;
input = CInput.Multiline_int(' ', 3, ref cnt);
for (int i = 0; i < cnt; i++) {
int value = input[i, 0] + input[i, 1];
if (input[i, 0] == -1 || input[i, 1] == -1)
Console.WriteLine("F");
else if (value >= 80)
Console.WriteLine("A");
else if (value >= 65)
Console.WriteLine("B");
else if (value >= 50)
Console.WriteLine("C");
else if (value < 30)
Console.WriteLine("F");
else if (input[i, 2] >= 50)
Console.WriteLine("C");
else
Console.WriteLine("F");
}
}
}
class Input {
public enum Define {
MAX_ArraySize = 1000,
ArraySize2d = 100, // 2?¬?????????????[][?] ???????
}
public string Line1_string() { return Console.ReadLine(); }
public string[] Line1_string(int chr) {
var input = Console.ReadLine();
var split = input.Split(' ');
return split;
}
public int Line1_int() {
var input = Console.ReadLine();
return int.Parse(input);
}
public double Line1_double() {
var input = Console.ReadLine();
return double.Parse(input);
}
public int[] Line1_int(int chr, int num) {
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int i = 0; i < num; i++) {
spliti[i] = int.Parse(split[i]);
}
return spliti;
}
public int[] Multiline_int(ref int datanum) {
int i = 0;
int[] data = new int[(int)Input.Define.MAX_ArraySize];
while (true) {
var input = Console.ReadLine();
var value = int.Parse(input);
if (value == 0)
break;
data[i] = value;
i++;
}
datanum = i;
return data;
}
/// <summary>
/// ?????°??????int??????????????????????????????
/// </summary>
/// <param name="chr">???????????????</param>
/// <param name="num">?????????????????????????????°</param>
/// <param name="datanum">??????????????????????????°</param>
/// <returns></returns>
public int[,] Multiline_int(int chr, int num, ref int datanum) {
int i = 0, zerocount = 0;
int[,] data =
new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
while (true) {
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
zerocount = 0;
for (int j = 0; j < num; j++) {
spliti[j] = int.Parse(split[j]);
if (spliti[j] == -1)
zerocount++;
}
if (zerocount == num)
break;
for (int j = 0; j < num; j++) {
if (spliti[0] == 0 && spliti[1] == 0)
break; // ???????????????????????????
}
for (int j = 0; j < num; j++) {
data[i, j] = spliti[j];
}
i++;
}
datanum = i;
return data;
}
/// <summary>
/// ?????°??????int??????????????????????????????
/// </summary>
/// <param name="chr">???????????????</param>
/// <param name="num">?????????????????????????????°</param>
/// <param name="loadnum">???????????????????????°</param>
/// <returns></returns>
public int[,] Multiline_int(int chr, int num, int loadnum) {
int i = 0;
int[,] data =
new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
while (true) {
if (loadnum == i)
break;
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int j = 0; j < num; j++) {
spliti[j] = int.Parse(split[j]);
}
for (int j = 0; j < num; j++) {
data[i, j] = spliti[j];
}
i++;
}
return data;
}
}
class EasyTask {
public void Swap(ref int a, ref int b) {
int buf = 0;
buf = a;
a = b;
b = buf;
}
}
|
using System;
class Program {
static void Main(string[] args) {
Input CInput = new Input();
// EasyTask CEasyTask = new EasyTask();
// int input = 0;
// int[] input = new int[(int)Input.Define.MAX_ArraySize];
// int[,] input = new int[(int)Input.Define.MAX_ArraySize,
// (int)Input.Define.ArraySize2d]; int num = 0; input = CInput.Line1_int();
// input = CInput.Multiline_int(' ', 2, ref num);
int[,] input =
new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
// int input3_count = 0;
int cnt = 0;
input = CInput.Multiline_int(' ', 3, ref cnt);
for (int i = 0; i < cnt; i++) {
int value = input[i, 0] + input[i, 1];
if (input[i, 0] == -1 || input[i, 1] == -1)
Console.WriteLine("F");
else if (value >= 80)
Console.WriteLine("A");
else if (value >= 65)
Console.WriteLine("B");
else if (value >= 50)
Console.WriteLine("C");
else if (value < 30)
Console.WriteLine("F");
else if (input[i, 2] >= 50)
Console.WriteLine("C");
else
Console.WriteLine("D");
}
}
}
class Input {
public enum Define {
MAX_ArraySize = 1000,
ArraySize2d = 100, // 2?¬?????????????[][?] ???????
}
public string Line1_string() { return Console.ReadLine(); }
public string[] Line1_string(int chr) {
var input = Console.ReadLine();
var split = input.Split(' ');
return split;
}
public int Line1_int() {
var input = Console.ReadLine();
return int.Parse(input);
}
public double Line1_double() {
var input = Console.ReadLine();
return double.Parse(input);
}
public int[] Line1_int(int chr, int num) {
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int i = 0; i < num; i++) {
spliti[i] = int.Parse(split[i]);
}
return spliti;
}
public int[] Multiline_int(ref int datanum) {
int i = 0;
int[] data = new int[(int)Input.Define.MAX_ArraySize];
while (true) {
var input = Console.ReadLine();
var value = int.Parse(input);
if (value == 0)
break;
data[i] = value;
i++;
}
datanum = i;
return data;
}
/// <summary>
/// ?????°??????int??????????????????????????????
/// </summary>
/// <param name="chr">???????????????</param>
/// <param name="num">?????????????????????????????°</param>
/// <param name="datanum">??????????????????????????°</param>
/// <returns></returns>
public int[,] Multiline_int(int chr, int num, ref int datanum) {
int i = 0, zerocount = 0;
int[,] data =
new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
while (true) {
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
zerocount = 0;
for (int j = 0; j < num; j++) {
spliti[j] = int.Parse(split[j]);
if (spliti[j] == -1)
zerocount++;
}
if (zerocount == num)
break;
for (int j = 0; j < num; j++) {
if (spliti[0] == 0 && spliti[1] == 0)
break; // ???????????????????????????
}
for (int j = 0; j < num; j++) {
data[i, j] = spliti[j];
}
i++;
}
datanum = i;
return data;
}
/// <summary>
/// ?????°??????int??????????????????????????????
/// </summary>
/// <param name="chr">???????????????</param>
/// <param name="num">?????????????????????????????°</param>
/// <param name="loadnum">???????????????????????°</param>
/// <returns></returns>
public int[,] Multiline_int(int chr, int num, int loadnum) {
int i = 0;
int[,] data =
new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
while (true) {
if (loadnum == i)
break;
var input = Console.ReadLine();
var split = input.Split(' ');
int[] spliti = new int[100];
for (int j = 0; j < num; j++) {
spliti[j] = int.Parse(split[j]);
}
for (int j = 0; j < num; j++) {
data[i, j] = spliti[j];
}
i++;
}
return data;
}
}
class EasyTask {
public void Swap(ref int a, ref int b) {
int buf = 0;
buf = a;
a = b;
b = buf;
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 955
| 2
|
using System;
namespace AOJ {
class Program {
static void Main(string[] args) {
while (true) {
var read = Console.ReadLine();
var temp_string = read.Split(' ');
int m = int.Parse(temp_string[0]), r = int.Parse(temp_string[1]),
f = int.Parse(temp_string[2]);
if (m == -1 && r == -1 && f == -1) {
break;
}
if (m == -1 || r == -1 || m + r < 30) {
Console.WriteLine("F");
} else if (m + r <= 80) {
Console.WriteLine("A");
} else if (m + r <= 65) {
Console.WriteLine("B");
} else if (m + r <= 50) {
Console.WriteLine("C");
} else if (m + r <= 30) {
if (f <= 50) {
Console.WriteLine("C");
} else {
Console.WriteLine("D");
}
}
}
}
}
}
|
using System;
namespace AOJ {
class Program {
static void Main(string[] args) {
while (true) {
var read = Console.ReadLine();
var temp_string = read.Split(' ');
int m = int.Parse(temp_string[0]), r = int.Parse(temp_string[1]),
f = int.Parse(temp_string[2]);
if (m == -1 && r == -1 && f == -1) {
break;
}
if (m == -1 || r == -1 || m + r < 30) {
Console.WriteLine("F");
} else if (m + r >= 80) {
Console.WriteLine("A");
} else if (m + r >= 65) {
Console.WriteLine("B");
} else if (m + r >= 50) {
Console.WriteLine("C");
} else if (m + r >= 30) {
if (f >= 50) {
Console.WriteLine("C");
} else {
Console.WriteLine("D");
}
}
}
}
}
}
|
[["-", 8, 196, 0, 57, 75, 57, 15, 16, 17, 19], ["+", 8, 196, 0, 57, 75, 57, 15, 16, 17, 20], ["-", 0, 57, 75, 57, 75, 57, 15, 16, 17, 19], ["+", 0, 57, 75, 57, 75, 57, 15, 16, 17, 20], ["-", 75, 57, 75, 57, 75, 57, 15, 16, 17, 19], ["+", 75, 57, 75, 57, 75, 57, 15, 16, 17, 20], ["-", 75, 57, 64, 196, 0, 57, 15, 16, 17, 19], ["+", 75, 57, 64, 196, 0, 57, 15, 16, 17, 20]]
| 8
| 236
| 10
|
using System;
using System.Linq;
class Program {
static void Main(string[] args) {
int hyo;
while (true) {
int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
if (x[0] == x[1] && x[1] == x[2] && x[0] == -1) {
break;
} else {
hyo = x[1] + x[0];
if ((x[1] == -1) || (x[0] == -1)) {
Console.WriteLine("F");
} else if (hyo >= 80) {
Console.WriteLine("A");
} else if (hyo < 80 && hyo >= 65) {
Console.WriteLine("B");
} else if (hyo < 65 && hyo >= 50) {
Console.WriteLine("C");
} else if (hyo < 50 && hyo >= 35) {
if (x[2] < 50) {
Console.WriteLine("D");
} else {
Console.WriteLine("C");
}
} else if (hyo < 35) {
{ Console.WriteLine("F"); }
}
}
}
Console.ReadLine();
}
}
|
using System;
using System.Linq;
class Program {
static void Main(string[] args) {
int hyo;
while (true) {
int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
if (x[0] == x[1] && x[1] == x[2] && x[0] == -1) {
break;
} else {
hyo = x[1] + x[0];
if ((x[1] == -1) || (x[0] == -1)) {
Console.WriteLine("F");
} else if (hyo >= 80) {
Console.WriteLine("A");
} else if (hyo < 80 && hyo >= 65) {
Console.WriteLine("B");
} else if (hyo < 65 && hyo >= 50) {
Console.WriteLine("C");
} else if (hyo < 50 && hyo >= 30) {
if (x[2] < 50) {
Console.WriteLine("D");
} else {
Console.WriteLine("C");
}
} else if (hyo < 30) {
{ Console.WriteLine("F"); }
}
}
}
Console.ReadLine();
}
}
|
[["-", 75, 57, 75, 57, 15, 16, 12, 16, 12, 203], ["+", 75, 57, 75, 57, 15, 16, 12, 16, 12, 203], ["-", 75, 57, 75, 57, 75, 57, 15, 16, 12, 203], ["+", 75, 57, 75, 57, 75, 57, 15, 16, 12, 203]]
| 8
| 273
| 4
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace StartFinish {
class Program {
static void Main(string[] args) {
while (true) {
//?????????
int[] mfr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
int m = mfr[0];
int f = mfr[1];
int r = mfr[2];
if (m == -1 && f == -1 && r == -1) {
break;
}
int sum = m + f;
//?????¶????????????
if (m == -1 || f == 1) {
Console.WriteLine("F");
continue;
} else if (sum >= 80) {
Console.WriteLine("A");
continue;
} else if (65 <= sum && sum < 80) {
Console.WriteLine("B");
continue;
} else if (50 <= sum && sum < 65) {
Console.WriteLine("C");
continue;
} else if (30 <= sum && sum < 50) {
if (r >= 50) {
Console.WriteLine("C");
continue;
} else {
Console.WriteLine("D");
continue;
}
} else {
Console.WriteLine("F");
}
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace StartFinish {
class Program {
static void Main(string[] args) {
while (true) {
//?????????
int[] mfr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
int m = mfr[0];
int f = mfr[1];
int r = mfr[2];
if (m == -1 && f == -1 && r == -1) {
break;
}
int sum = m + f;
//?????¶????????????
if (m == -1 || f == -1) {
Console.WriteLine("F");
continue;
} else if (sum >= 80) {
Console.WriteLine("A");
continue;
} else if (65 <= sum && sum < 80) {
Console.WriteLine("B");
continue;
} else if (50 <= sum && sum < 65) {
Console.WriteLine("C");
continue;
} else if (30 <= sum && sum < 50) {
if (r >= 50) {
Console.WriteLine("C");
continue;
} else {
Console.WriteLine("D");
continue;
}
} else {
Console.WriteLine("F");
}
}
}
}
}
|
[["+", 0, 57, 15, 16, 12, 16, 12, 241, 0, 33]]
| 8
| 283
| 1
|
using System;
using System.Collections.Generic;
class program {
static void Main() {
List<int> Sdate = new List<int> {};
Sdate = Dateinp();
int[,] Date = DateArray(Sdate);
for (int i = 0; i < Date.GetLength(0) - 1; i++) {
if ((Date[i, 0] == -1) || (Date[i, 1] == -1))
Console.WriteLine("F");
if ((Date[i, 0] + Date[i, 1]) >= 80) {
Console.WriteLine("A");
}
else {
if ((Date[i, 0] + Date[i, 1]) >= 60) {
Console.WriteLine("B");
} else {
if (Date[i, 0] + Date[i, 1] >= 50) {
Console.WriteLine("C");
}
else {
if (Date[i, 0] + Date[i, 1] >= 30) {
if (Date[i, 2] >= 50) {
Console.WriteLine("C");
} else {
Console.WriteLine("D");
}
} else {
Console.WriteLine("F");
}
}
}
}
}
}
static int[,] DateArray(List<int> list) {
int length = list.Count;
int Row = length / 3;
int[,] datearray = new int[Row, 3];
int count = 0;
for (int i = 0; i < Row; i++) {
for (int j = 0; j < 3; j++) {
datearray[i, j] = list[count];
count += 1;
}
}
return datearray;
}
static List<int> Dateinp() {
List<int> Date = new List<int> {};
while (true) {
int x;
int y;
int z;
string[] str = Console.ReadLine().Split(' ');
x = int.Parse(str[0]);
y = int.Parse(str[1]);
z = int.Parse(str[2]);
Date.Add(x);
Date.Add(y);
Date.Add(z);
int End = x + y + z;
if (End == -3)
break;
}
return Date;
}
}
|
using System;
using System.Collections.Generic;
class program {
static void Main() {
List<int> Sdate = new List<int> {};
Sdate = Dateinp();
int[,] Date = DateArray(Sdate);
for (int i = 0; i < Date.GetLength(0) - 1; i++) {
if ((Date[i, 0] == -1) || (Date[i, 1] == -1)) {
Console.WriteLine("F");
} else {
if ((Date[i, 0] + Date[i, 1]) >= 80) {
Console.WriteLine("A");
}
else {
if ((Date[i, 0] + Date[i, 1]) >= 65) {
Console.WriteLine("B");
} else {
if (Date[i, 0] + Date[i, 1] >= 50) {
Console.WriteLine("C");
}
else {
if (Date[i, 0] + Date[i, 1] >= 30) {
if (Date[i, 2] >= 50) {
Console.WriteLine("C");
} else {
Console.WriteLine("D");
}
} else {
Console.WriteLine("F");
}
}
}
}
}
}
}
static int[,] DateArray(List<int> list) {
int length = list.Count;
int Row = length / 3;
int[,] datearray = new int[Row, 3];
int count = 0;
for (int i = 0; i < Row; i++) {
for (int j = 0; j < 3; j++) {
datearray[i, j] = list[count];
count += 1;
}
}
return datearray;
}
static List<int> Dateinp() {
List<int> Date = new List<int> {};
while (true) {
int x;
int y;
int z;
string[] str = Console.ReadLine().Split(' ');
x = int.Parse(str[0]);
y = int.Parse(str[1]);
z = int.Parse(str[2]);
Date.Add(x);
Date.Add(y);
Date.Add(z);
int End = x + y + z;
if (End == -3)
break;
}
return Date;
}
}
|
[["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 45], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 46], ["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 196, 0, 45], ["-", 0, 57, 75, 196, 0, 57, 15, 16, 12, 203], ["+", 0, 57, 75, 196, 0, 57, 15, 16, 12, 203], ["+", 0, 57, 75, 196, 0, 57, 75, 196, 0, 46]]
| 8
| 510
| 7
|
using System;
using System.Linq;
namespace Structured_Program_II {
class Grading {
static void Main(string[] args) {
while (true) {
var array =
Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
var m = array[0];
var f = array[1];
var r = array[2];
var sum = m + f;
if (m == -1 && f == -1 && r == -1)
break;
if (m == -1 || f == -1)
Console.WriteLine("F");
else if (sum >= 80)
Console.WriteLine("A");
else if (sum >= 60 && sum < 80)
Console.WriteLine("B");
else if (sum >= 50 && sum < 60)
Console.WriteLine("C");
else if (sum >= 30 && sum < 50)
if (r >= 50)
Console.WriteLine("C");
else
Console.WriteLine("D");
else
Console.WriteLine("F");
}
}
}
}
|
using System;
using System.Linq;
namespace Structured_Program_II {
class Grading {
static void Main(string[] args) {
while (true) {
var array =
Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
var m = array[0];
var f = array[1];
var r = array[2];
var sum = m + f;
if (m == -1 && f == -1 && r == -1)
break;
if (m == -1 || f == -1)
Console.WriteLine("F");
else if (sum >= 80)
Console.WriteLine("A");
else if (sum >= 65 && sum < 80)
Console.WriteLine("B");
else if (sum >= 50 && sum < 65)
Console.WriteLine("C");
else if (sum >= 30 && sum < 50)
if (r >= 50)
Console.WriteLine("C");
else
Console.WriteLine("D");
else
Console.WriteLine("F");
}
}
}
}
|
[["-", 75, 57, 75, 57, 15, 16, 31, 16, 12, 203], ["+", 75, 57, 75, 57, 15, 16, 31, 16, 12, 203], ["-", 75, 57, 75, 57, 15, 16, 12, 16, 12, 203], ["+", 75, 57, 75, 57, 15, 16, 12, 16, 12, 203]]
| 8
| 238
| 4
|
using System;
namespace AOJ {
class Program {
static void Main() {
string[] data;
int m, f, r, mf;
char g;
while (true) {
data = Console.ReadLine().Split(' ');
m = int.Parse(data[0]);
f = int.Parse(data[1]);
r = int.Parse(data[2]);
if (m == -1 && f == -1 && r == -1)
break;
mf = m + f;
if (m == -1 || f == -1 || mf < 30)
g = 'F';
else if (mf >= 80)
g = 'A';
else if (mf > 65)
g = 'B';
else if (r >= 50 || mf >= 50)
g = 'C';
else
g = 'D';
Console.WriteLine(g);
}
}
}
}
|
using System;
namespace AOJ {
class Program {
static void Main() {
string[] data;
int m, f, r, mf;
char g;
while (true) {
data = Console.ReadLine().Split(' ');
m = int.Parse(data[0]);
f = int.Parse(data[1]);
r = int.Parse(data[2]);
if (m == -1 && f == -1 && r == -1)
break;
mf = m + f;
if (m == -1 || f == -1 || mf < 30)
g = 'F';
else if (mf >= 80)
g = 'A';
else if (mf >= 65)
g = 'B';
else if (r >= 50 || mf >= 50)
g = 'C';
else
g = 'D';
Console.WriteLine(g);
}
}
}
}
|
[["-", 0, 57, 75, 57, 75, 57, 15, 16, 17, 47], ["+", 0, 57, 75, 57, 75, 57, 15, 16, 17, 20]]
| 8
| 196
| 2
|
using System;
class Program {
static void Main() {
int i = 0, j;
int[] m = new int[256];
int[] f = new int[256];
int[] r = new int[256];
while (true) {
string inp = Console.ReadLine();
string[] data = inp.Split(' ');
m[i] = int.Parse(data[0]);
f[i] = int.Parse(data[1]);
r[i] = int.Parse(data[2]);
if (m[i] == -1 && f[i] == -1 && r[i] == -1) {
break;
}
i++;
}
for (j = 0; j < i; j++) {
if (m[j] == -1 || f[j] == -1) {
Console.WriteLine("F");
}
if (m[j] + f[j] >= 80) {
Console.WriteLine("A");
} else if (m[j] + f[j] >= 65) {
Console.WriteLine("B");
} else if (m[j] + f[j] >= 50) {
Console.WriteLine("C");
} else if (r[j] >= 50) {
Console.WriteLine("C");
} else if (m[j] + f[j] >= 30) {
Console.WriteLine("D");
} else {
Console.WriteLine("F");
}
}
}
}
|
using System;
class Program {
static void Main() {
int i = 0, j;
int[] m = new int[256];
int[] f = new int[256];
int[] r = new int[256];
while (true) {
string inp = Console.ReadLine();
string[] data = inp.Split(' ');
m[i] = int.Parse(data[0]);
f[i] = int.Parse(data[1]);
r[i] = int.Parse(data[2]);
if (m[i] == -1 && f[i] == -1 && r[i] == -1) {
break;
}
i++;
}
for (j = 0; j < i; j++) {
if (m[j] == -1 || f[j] == -1) {
Console.WriteLine("F");
} else if (m[j] + f[j] >= 80) {
Console.WriteLine("A");
} else if (m[j] + f[j] >= 65) {
Console.WriteLine("B");
} else if (m[j] + f[j] >= 50) {
Console.WriteLine("C");
} else if (r[j] >= 50) {
Console.WriteLine("C");
} else if (m[j] + f[j] >= 30) {
Console.WriteLine("D");
} else {
Console.WriteLine("F");
}
}
}
}
|
[["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 95]]
| 8
| 341
| 1
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// using System.Threading.Tasks;
namespace IPT1_7B {
class Program {
static void Main(string[] args) {
int ans;
Boolean ansNoDuplicate;
// loop true
while (true) {
ans = 0;
// input n x
String[] in_num = Console.ReadLine().Split(' ');
int n = int.Parse(in_num[0]);
int x = int.Parse(in_num[1]);
// check n = x = 0 then break
if ((n == 0) && (x == 0))
break;
// create array n * n
// int[,] array_ans = new int[n, n];
int[,] array_ans = new int[n, 3];
int[] array_abc = new int[3];
// loop a 0 -> n - 1
for (int a = 1; a <= n; a++) {
// loop b a + 1 -> n - 1
for (int b = a + 1; b <= n; b++) {
// calc c = x - (a + b)
int c = x - (a + b);
// check c <= n
// check a != b and a !=c and b != c
if ((0 < c) && (c <= n) && (a != b) && (a != c) && (b != c)) {
ansNoDuplicate = true;
array_abc[0] = a;
array_abc[1] = b;
array_abc[2] = c;
Array.Sort(array_abc);
for (int i = 0; i < ans; i++) {
if ((array_ans[i, 0] == array_abc[0]) &&
(array_ans[i, 1] == array_abc[1]) &&
(array_ans[i, 2] == array_abc[2]))
ansNoDuplicate = false;
}
if (ansNoDuplicate == true) {
// Console.WriteLine(array_abc[0] + "+" + array_abc[1] + "+" +
// array_abc[2]);
array_ans[ans, 0] = array_abc[0];
array_ans[ans, 1] = array_abc[1];
array_ans[ans, 2] = array_abc[2];
// Console.WriteLine(a + "+" + b + "+" + c);
// count up yes ans
ans++;
}
}
}
}
// print ans count
Console.WriteLine(ans);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// using System.Threading.Tasks;
namespace IPT1_7B {
class Program {
static void Main(string[] args) {
int ans;
Boolean ansNoDuplicate;
// loop true
while (true) {
ans = 0;
// input n x
String[] in_num = Console.ReadLine().Split(' ');
int n = int.Parse(in_num[0]);
int x = int.Parse(in_num[1]);
// check n = x = 0 then break
if ((n == 0) && (x == 0))
break;
// create array n * n
// int[,] array_ans = new int[n, n];
int[,] array_ans = new int[n * n * n, 3];
int[] array_abc = new int[3];
// loop a 0 -> n - 1
for (int a = 1; a <= n; a++) {
// loop b a + 1 -> n - 1
for (int b = a + 1; b <= n; b++) {
// calc c = x - (a + b)
int c = x - (a + b);
// check c <= n
// check a != b and a !=c and b != c
if ((0 < c) && (c <= n) && (a != b) && (a != c) && (b != c)) {
ansNoDuplicate = true;
array_abc[0] = a;
array_abc[1] = b;
array_abc[2] = c;
Array.Sort(array_abc);
for (int i = 0; i < ans; i++) {
if ((array_ans[i, 0] == array_abc[0]) &&
(array_ans[i, 1] == array_abc[1]) &&
(array_ans[i, 2] == array_abc[2]))
ansNoDuplicate = false;
}
if (ansNoDuplicate == true) {
// Console.WriteLine(array_abc[0] + "+" + array_abc[1] + "+" +
// array_abc[2]);
array_ans[ans, 0] = array_abc[0];
array_ans[ans, 1] = array_abc[1];
array_ans[ans, 2] = array_abc[2];
// Console.WriteLine(a + "+" + b + "+" + c);
// count up yes ans
ans++;
}
}
}
}
// print ans count
Console.WriteLine(ans);
}
}
}
}
|
[["+", 39, 224, 225, 226, 0, 16, 31, 16, 17, 48], ["+", 39, 224, 225, 226, 0, 16, 31, 16, 12, 22], ["+", 0, 227, 39, 224, 225, 226, 0, 16, 17, 48], ["+", 0, 227, 39, 224, 225, 226, 0, 16, 12, 22]]
| 8
| 385
| 4
|
using System;
namespace AOJ {
class Program {
static void Main(string[] args) {
while (true) {
var read = Console.ReadLine();
var temp_string = read.Split(' ');
int n = int.Parse(temp_string[0]), x = int.Parse(temp_string[1]),
count = 0;
if (n == 0 && x == 0) {
break;
}
for (int i = 1; i < n - 2; i++) {
for (int j = i + 1; j <= n - 1; j++) {
for (int k = j + 1; k <= n; k++) {
if (i + j + k == x) {
count++;
}
}
}
}
Console.WriteLine(count);
}
}
}
}
|
using System;
namespace AOJ {
class Program {
static void Main(string[] args) {
while (true) {
var read = Console.ReadLine();
var temp_string = read.Split(' ');
int n = int.Parse(temp_string[0]), x = int.Parse(temp_string[1]),
count = 0;
if (n == 0 && x == 0) {
break;
}
for (int i = 1; i <= n - 2; i++) {
for (int j = i + 1; j <= n - 1; j++) {
for (int k = j + 1; k <= n; k++) {
if (i + j + k == x) {
count++;
}
}
}
}
Console.WriteLine(count);
}
}
}
}
|
[["-", 0, 52, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 196, 0, 7, 15, 16, 17, 19]]
| 8
| 170
| 2
|
using System;
namespace Project {
class MainClass {
public static void Main(string[] args) {
while (true) {
string s = Console.ReadLine();
string[] sar = s.Split(' ');
int n = int.Parse(sar[0]);
int x = int.Parse(sar[1]);
if (n == 0 && x == 0) {
break;
}
int count = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
for (int k = 0; k < n; k++) {
if (i + j + k + 3 == x) {
count++;
}
}
}
}
Console.WriteLine(count);
}
}
}
}
|
using System;
namespace Project {
class MainClass {
public static void Main(string[] args) {
while (true) {
string s = Console.ReadLine();
string[] sar = s.Split(' ');
int n = int.Parse(sar[0]);
int x = int.Parse(sar[1]);
if (n == 0 && x == 0) {
break;
}
int count = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
for (int k = j + 1; k < n; k++) {
if (i + j + k + 3 == x) {
count++;
}
}
}
}
Console.WriteLine(count);
}
}
}
}
|
[["-", 0, 7, 10, 198, 0, 200, 0, 212, 0, 203], ["+", 10, 198, 0, 200, 0, 212, 0, 16, 31, 22], ["+", 10, 198, 0, 200, 0, 212, 0, 16, 17, 72], ["+", 10, 198, 0, 200, 0, 212, 0, 16, 12, 203]]
| 8
| 169
| 8
|
// ITP1_7_B
//???????????? 45???
using System;
using System.Collections.Generic;
class ITP1_7_B {
static void Main(string[] args) {
int count = 0;
int[] result = new int[30];
while (true) {
int[] st = Array.ConvertAll<string, int>(
(Console.ReadLine().Split(' ')),
delegate(string value) { return int.Parse(value); });
if (st[0] == 0 || st[1] == 0)
break;
else
result[count++] = judge(st[0], st[1]);
}
for (int i = 0; i < count; i++)
Console.WriteLine(result[i]);
}
private static int judge(int n, int x) {
int ans = 0;
for (int i = 1; i <= n; i++) {
for (int j = i + 1; j <= n; j++) {
for (int k = j + 1; k <= n; k++) {
if (x == k + j + i)
ans++;
}
}
}
return ans;
}
}
|
// ITP1_7_B
//???????????? 45???
using System;
using System.Collections.Generic;
class ITP1_7_B {
static void Main(string[] args) {
int count = 0;
int[] result = new int[100];
while (true) {
int[] st = Array.ConvertAll<string, int>(
(Console.ReadLine().Split(' ')),
delegate(string value) { return int.Parse(value); });
if (st[0] == 0 && st[1] == 0)
break;
else
result[count++] = judge(st[0], st[1]);
}
for (int i = 0; i < count; i++)
Console.WriteLine(result[i]);
}
private static int judge(int n, int x) {
int ans = 0;
for (int i = 1; i <= n; i++) {
for (int j = i + 1; j <= n; j++) {
for (int k = j + 1; k <= n; k++) {
if (x == k + j + i)
ans++;
}
}
}
return ans;
}
}
|
[["-", 0, 212, 0, 227, 39, 224, 225, 226, 0, 203], ["+", 0, 212, 0, 227, 39, 224, 225, 226, 0, 203], ["-", 0, 52, 8, 196, 0, 57, 15, 16, 17, 106], ["+", 0, 52, 8, 196, 0, 57, 15, 16, 17, 98]]
| 8
| 243
| 4
|
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
namespace LogicSummoner {
class Program {
static void Main(string[] args) {
while (true) {
var nums = GetNumbersInt();
var n = nums[0];
var x = nums[1];
if (n == 0 && x == 0) {
break;
}
var count = 0;
// 1-3
for (int i = 1; i < n - 1; i++) {
// 2-4
for (int j = 2; j < n; j++) {
var k = x - i - j;
if (j < k && k < n + 1) {
count++;
}
}
}
Console.WriteLine(count);
}
}
// static StreamReader Console = new StreamReader("input.txt");
static int GetNumber() { return int.Parse(Console.ReadLine().Trim()); }
static double GetDounble() { return double.Parse(Console.ReadLine().Trim()); }
static int[] GetNumbersInt(int n = 0) {
return Console.ReadLine()
.Trim()
.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => int.Parse(x))
.ToArray();
}
static long[] GetNumbersLong(int n = 0) {
return Console.ReadLine()
.Trim()
.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => long.Parse(x))
.ToArray();
}
static double[] GetNumbersDouble(int n = 0) {
return Console.ReadLine()
.Trim()
.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => double.Parse(x))
.ToArray();
}
static string[] GetStrings(int n = 0) {
return Console.ReadLine()
.Trim()
.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
.ToArray();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
namespace LogicSummoner {
class Program {
static void Main(string[] args) {
while (true) {
var nums = GetNumbersInt();
var n = nums[0];
var x = nums[1];
if (n == 0 && x == 0) {
break;
}
var count = 0;
// 1-3
for (int i = 1; i < n - 1; i++) {
// 2-4
for (int j = i + 1; j < n; j++) {
var k = x - i - j;
if (j < k && k < n + 1) {
count++;
}
}
}
System.Console.WriteLine(count);
}
}
// static StreamReader Console = new StreamReader("input.txt");
static int GetNumber() { return int.Parse(Console.ReadLine().Trim()); }
static double GetDounble() { return double.Parse(Console.ReadLine().Trim()); }
static int[] GetNumbersInt(int n = 0) {
return Console.ReadLine()
.Trim()
.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => int.Parse(x))
.ToArray();
}
static long[] GetNumbersLong(int n = 0) {
return Console.ReadLine()
.Trim()
.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => long.Parse(x))
.ToArray();
}
static double[] GetNumbersDouble(int n = 0) {
return Console.ReadLine()
.Trim()
.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => double.Parse(x))
.ToArray();
}
static string[] GetStrings(int n = 0) {
return Console.ReadLine()
.Trim()
.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
.ToArray();
}
}
}
|
[["-", 0, 7, 10, 198, 0, 200, 0, 212, 0, 203], ["+", 10, 198, 0, 200, 0, 212, 0, 16, 31, 22], ["+", 10, 198, 0, 200, 0, 212, 0, 16, 17, 72], ["+", 10, 198, 0, 200, 0, 212, 0, 16, 12, 203], ["+", 0, 1, 0, 213, 63, 214, 205, 214, 205, 22], ["+", 0, 1, 0, 213, 63, 214, 205, 214, 0, 131]]
| 8
| 425
| 6
|
using System;
using System.Collections.Generic;
using System.Linq;
namespace ITP1_7_B {
class Program {
// 161700
static void Main(string[] args) {
List<int> map = new List<int>(161700);
string[] input;
int num;
int total;
while ((input = Console.ReadLine().Split(' ')).All(s => s != "0")) {
map.Clear();
num = Convert.ToInt32(input[0]);
total = Convert.ToInt32(input[1]);
for (int i = num; i > 0; i--) {
for (int j = i - 1; j > 0; j--) {
int sum1 = i + j;
for (int k = j - 1; k > 0; k--) {
map.Add(sum1 + k);
}
}
}
Console.WriteLine(map.Count(i => i == total));
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
namespace ITP1_7_B {
class Program {
static void Main(string[] args) {
List<int> map = new List<int>(161700);
string[] input;
int num;
int total;
while (!(input = Console.ReadLine().Split(' ')).All(s => s == "0")) {
map.Clear();
num = Convert.ToInt32(input[0]);
total = Convert.ToInt32(input[1]);
for (int i = num; i > 0; i--) {
for (int j = i - 1; j > 0; j--) {
int sum1 = i + j;
for (int k = j - 1; k > 0; k--) {
map.Add(sum1 + k);
}
}
}
Console.WriteLine(map.Count(i => i == total));
}
}
}
}
|
[["+", 0, 195, 8, 196, 0, 52, 15, 241, 0, 111], ["-", 3, 4, 0, 28, 0, 218, 8, 16, 17, 79], ["+", 3, 4, 0, 28, 0, 218, 8, 16, 17, 60]]
| 8
| 207
| 3
|
using System;
public class Program {
public static void Main(string[] args) {
while (true) {
string[] read = Console.ReadLine().Split(' ');
int range = int.Parse(read[0]);
int total = int.Parse(read[1]);
int count = 0;
if (range == 0 && total == 0)
break;
for (int i = 1; i <= range; i++) {
for (int j = i; j <= range; j++) {
for (int k = j; k <= range; k++) {
if (i == j || j == k || k == i)
continue;
// else Console.Write(i + " " + j + " " + k);
if (i + j + k == total) {
count++;
// Console.WriteLine("o");
}
Console.WriteLine();
}
}
}
Console.WriteLine(count);
}
}
}
|
using System;
public class Program {
public static void Main(string[] args) {
while (true) {
string[] read = Console.ReadLine().Split(' ');
int range = int.Parse(read[0]);
int total = int.Parse(read[1]);
int count = 0;
if (range == 0 && total == 0)
break;
for (int i = 1; i <= range; i++) {
for (int j = i; j <= range; j++) {
for (int k = j; k <= range; k++) {
if (i == j || j == k || k == i)
continue;
// else Console.Write(i + " " + j + " " + k);
if (i + j + k == total) {
count++;
// Console.WriteLine("o");
}
// Console.WriteLine();
}
}
}
Console.WriteLine(count);
}
}
}
|
[["-", 8, 196, 0, 1, 0, 213, 63, 214, 205, 22], ["-", 8, 196, 0, 1, 0, 213, 63, 214, 0, 131], ["-", 8, 196, 0, 1, 0, 213, 63, 214, 141, 22], ["-", 8, 196, 0, 1, 0, 213, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 213, 3, 4, 0, 25], ["-", 8, 196, 0, 7, 8, 196, 0, 1, 0, 35]]
| 8
| 181
| 6
|
using System;
namespace ITP1_8_C {
class Program {
static void Main(string[] args) {
int[] counter = new int[26];
while (true) {
string str1 = Console.ReadLine();
if (str1 == "")
break;
if (1200 <= str1.Length)
Environment.Exit(0);
string str = str1.ToLower();
for (int i = 0; i < str.Length; i++) {
if (str[i] - 'a' > 25 || str[i] - 'a' < 0)
continue;
counter[str[i] - 'a']++;
}
}
for (int i = 0; i < 'z' - 'a' + 1; i++) {
Console.WriteLine("{0} : {1}", Convert.ToChar('a' + i), counter[i]);
}
}
}
}
|
using System;
namespace ITP1_8_C {
class Program {
static void Main(string[] args) {
int[] counter = new int[26];
while (true) {
string str1 = Console.ReadLine();
if (str1 == null)
break;
if (1200 <= str1.Length)
Environment.Exit(0);
string str = str1.ToLower();
for (int i = 0; i < str.Length; i++) {
if (str[i] - 'a' > 25 || str[i] - 'a' < 0)
continue;
counter[str[i] - 'a']++;
}
}
for (int i = 0; i < 'z' - 'a' + 1; i++) {
Console.WriteLine("{0} : {1}", Convert.ToChar('a' + i), counter[i]);
}
}
}
}
|
[["-", 8, 196, 0, 57, 15, 16, 12, 5, 0, 62], ["+", 0, 52, 8, 196, 0, 57, 15, 16, 12, 215]]
| 8
| 187
| 3
|
using System;
public class Hello {
static int[] ans = new int[100];
public static void aiueo(string str) {
for (int i = 0; i < str.Length; i++) {
if ((int)str[i] <= 90 && (int)str[i] >= 65)
ans[(int)str[i] - 65]++;
else if ((int)str[i] >= 97 && (int)str[i] <= 122)
ans[(int)str[i] - 97]++;
}
}
public static void Main() {
string str = Console.ReadLine();
for (; str != "";) {
aiueo(str);
str = Console.ReadLine();
}
for (int i = 97; i < 123; i++) {
Console.WriteLine("{0} : {1}", (char)i, ans[i - 97]);
}
// 46
}
}
|
using System;
public class Hello {
static int[] ans = new int[100];
public static void aiueo(string str) {
for (int i = 0; i < str.Length; i++) {
if ((int)str[i] <= 90 && (int)str[i] >= 65)
ans[(int)str[i] - 65]++;
else if ((int)str[i] >= 97 && (int)str[i] <= 122)
ans[(int)str[i] - 97]++;
}
}
public static void Main() {
string str = Console.ReadLine();
for (; str != null;) {
aiueo(str);
str = Console.ReadLine();
}
for (int i = 97; i < 123; i++) {
Console.WriteLine("{0} : {1}", (char)i, ans[i - 97]);
}
}
}
|
[["-", 8, 196, 0, 7, 15, 16, 12, 5, 0, 62], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 12, 215]]
| 8
| 200
| 3
|
using System;
namespace ConsoleApplication41 {
class Program {
static void Main(string[] args) {
//??¢???????????????????????????
string[] array = { "a", "b", "c", "d", "e", "f", "j", "h", "i",
"g", "k", "l", "m", "n", "o", "p", "q", "r",
"s", "t", "u", "v", "w", "x", "y", "z" };
int[] sum = new int[array.Length];
while (true) {
string input = Console.ReadLine();
//???????????£???????????????
if (input == null || input.Length == 0) {
break;
}
// char?????????
char[] chr = input.ToCharArray();
for (int i = 0; i < chr.Length; i++) {
//??§??????????°??????????
if (char.IsUpper(chr[i])) {
chr[i] = char.ToLower(chr[i]);
}
}
int iLength = chr.Length;
for (int i = 0; i < iLength; i++) {
// string????????´???
string p = chr[i].ToString();
//???????????????
for (int x = 0; x < 26; x++) {
if (array[x].Equals(p)) {
//????????£???????????????
if ('a' <= chr[i] || chr[i] <= 'z') {
sum[x] = sum[x] + 1;
}
}
}
}
}
for (int i = 0; i < array.Length; i++) {
Console.WriteLine(array[i] + " " + ":" + " " + sum[i]);
}
}
}
}
|
using System;
namespace ConsoleApplication41 {
class Program {
static void Main(string[] args) {
//??¢???????????????????????????
string[] array = { "a", "b", "c", "d", "e", "f", "g", "h", "i",
"j", "k", "l", "m", "n", "o", "p", "q", "r",
"s", "t", "u", "v", "w", "x", "y", "z" };
int[] sum = new int[array.Length];
while (true) {
string input = Console.ReadLine();
//???????????£???????????????
if (input == null || input.Length == 0) {
break;
}
// char?????????
char[] chr = input.ToCharArray();
for (int i = 0; i < chr.Length; i++) {
//??§??????????°??????????
if (char.IsUpper(chr[i])) {
chr[i] = char.ToLower(chr[i]);
}
}
int iLength = chr.Length;
for (int i = 0; i < iLength; i++) {
// string????????´???
string p = chr[i].ToString();
//???????????????
for (int x = 0; x < 26; x++) {
if (array[x].Equals(p)) {
//????????£???????????????
if ('a' <= chr[i] || chr[i] <= 'z') {
sum[x] = sum[x] + 1;
}
}
}
}
}
for (int i = 0; i < array.Length; i++) {
Console.WriteLine(array[i] + " " + ":" + " " + sum[i]);
}
}
}
}
|
[["-", 0, 200, 0, 212, 0, 229, 0, 5, 0, 222], ["+", 0, 200, 0, 212, 0, 229, 0, 5, 0, 222]]
| 8
| 386
| 4
|
using System;
namespace Project {
class MainClass {
public static void Main(string[] args) {
int[] count = new int[26];
int a = (int)'a';
while (true) {
string s = Console.ReadLine();
if (s == null)
break;
string ss = s.ToLower();
char[] c = new char[s.Length];
for (int i = 0; i < s.Length; i++) {
c[i] = (char)ss[i];
}
foreach (char ch in c) {
for (int i = 0; i < 26; i++) {
if (ch == (char)(a + i))
count[i] += 1;
}
}
}
for (int i = 0; i < 26; i++) {
Console.WriteLine("{ 0} : { 1}", (char)(a + i), count[i]);
}
}
}
}
|
using System;
namespace Project {
class MainClass {
public static void Main(string[] args) {
int[] count = new int[26];
int a = (int)'a';
while (true) {
string s = Console.ReadLine();
if (s == null)
break;
string ss = s.ToLower();
char[] c = new char[s.Length];
for (int i = 0; i < s.Length; i++) {
c[i] = (char)ss[i];
}
foreach (char ch in c) {
for (int i = 0; i < 26; i++) {
if (ch == (char)(a + i))
count[i] += 1;
}
}
}
for (int i = 0; i < 26; i++) {
Console.WriteLine("{0} : {1}", (char)(a + i), count[i]);
}
}
}
}
|
[["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222], ["+", 0, 213, 3, 4, 0, 28, 0, 5, 0, 222]]
| 8
| 204
| 2
|
using System;
public class Class1 {
public static void Main() {
string line;
int[] alphabet = new int[26];
while ((line = Console.ReadLine()) != null) {
char[] cs = line.ToCharArray();
for (int i = 0; i < cs.Length; i++) {
if (char.IsLetter(cs[i])) {
if (char.IsUpper(cs[i])) {
cs[i] = char.ToLower(cs[i]);
}
int num = cs[i] - 'a';
alphabet[num]++;
}
}
}
for (int j = 0; j < 26; j++) {
Console.WriteLine(('a' + j) + " : " + alphabet[j]);
}
}
}
|
using System;
public class Class1 {
public static void Main() {
string line;
int[] alphabet = new int[26];
while ((line = Console.ReadLine()) != null) {
char[] cs = line.ToCharArray();
for (int i = 0; i < cs.Length; i++) {
if (char.IsLetter(cs[i])) {
if (char.IsUpper(cs[i])) {
cs[i] = char.ToLower(cs[i]);
}
int num = cs[i] - 'a';
alphabet[num]++;
}
}
}
for (int j = 0; j < 26; j++) {
Console.WriteLine((char)('a' + j) + " : " + alphabet[j]);
}
}
}
|
[["+", 0, 28, 0, 16, 31, 16, 31, 74, 39, 199], ["+", 0, 28, 0, 16, 31, 16, 31, 74, 0, 25], ["+", 0, 16, 31, 16, 31, 74, 51, 23, 0, 24]]
| 8
| 174
| 3
|
using System;
using System.Collections.Generic;
using System.Linq;
class Program {
static void Main(string[] args) {
string str = Console.ReadLine();
char[] letter = str.ToArray();
string input = Console.ReadLine();
char[] inputletter = input.ToArray();
var index = new List<int>();
for (int i = 0; i < letter.Length; i++) {
if (inputletter[0] == letter[i]) {
index.Add(i);
}
}
bool judge = true;
for (int i = 0; i < index.Count; i++) {
int j;
int k;
for (j = index[i], k = 0; k < inputletter.Length; j++, k++) {
if (inputletter[k] != letter[j]) {
break;
}
if (j == letter.Length - 1) {
j = -1;
}
}
if (k == inputletter.Length) {
judge = true;
break;
} else {
judge = false;
}
}
if (judge) {
Console.WriteLine("Yes");
} else {
Console.WriteLine("No");
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
class Program {
static void Main(string[] args) {
string str = Console.ReadLine();
char[] letter = str.ToArray();
string input = Console.ReadLine();
char[] inputletter = input.ToArray();
var index = new List<int>();
for (int i = 0; i < letter.Length; i++) {
if (inputletter[0] == letter[i]) {
index.Add(i);
}
}
bool judge = false;
for (int i = 0; i < index.Count; i++) {
int j;
int k;
for (j = index[i], k = 0; k < inputletter.Length; j++, k++) {
if (inputletter[k] != letter[j]) {
break;
}
if (j == letter.Length - 1) {
j = -1;
}
}
if (k == inputletter.Length) {
judge = true;
break;
} else {
judge = false;
}
}
if (judge) {
Console.WriteLine("Yes");
} else {
Console.WriteLine("No");
}
}
}
|
[["-", 0, 198, 0, 200, 0, 212, 0, 211, 0, 146], ["+", 0, 198, 0, 200, 0, 212, 0, 211, 0, 147]]
| 8
| 259
| 2
|
using System;
namespace ITP1_8_D {
class Program {
static void Main(string[] args) {
string s = Console.ReadLine();
string p = Console.ReadLine();
string Ans = "No";
s = s + s;
for (int i = 0; i < (s.Length - p.Length); ++i) {
for (int j = 0; j < p.Length; ++j) {
if (s[i + j] != p[j])
break;
else if (j == p.Length - 1)
Ans = "YES";
}
}
Console.WriteLine("{0}", Ans);
}
}
}
|
using System;
namespace ITP1_8_D {
class Program {
static void Main(string[] args) {
string s = Console.ReadLine();
string p = Console.ReadLine();
string Ans = "No";
s = s + s;
for (int i = 0; i < (s.Length - p.Length); ++i) {
for (int j = 0; j < p.Length; ++j) {
if (s[i + j] != p[j])
break;
else if (j == p.Length - 1)
Ans = "Yes";
}
}
Console.WriteLine("{0}", Ans);
}
}
}
|
[["-", 75, 57, 64, 1, 0, 11, 12, 5, 0, 222], ["+", 75, 57, 64, 1, 0, 11, 12, 5, 0, 222]]
| 8
| 139
| 2
|
using System;
class ITP1 {
static void Main() {
string str = Console.ReadLine();
str += str;
string str2 = Console.ReadLine();
char[] ch = str.ToCharArray();
char[] ch2 = str2.ToCharArray();
int cnt = 0;
for (int i = 0; i < ch.Length / 2; i++) {
if (ch2[0] == ch[i]) {
for (int j = 0; j < ch2.Length; j++) {
if (ch2[0 + j] == ch[i + j]) {
cnt++;
}
}
if (cnt >= ch2.Length) {
Console.WriteLine("Yes");
return;
}
}
}
Console.WriteLine("No");
}
}
|
using System;
class ITP1 {
static void Main() {
string str = Console.ReadLine();
str += str;
string str2 = Console.ReadLine();
char[] ch = str.ToCharArray();
char[] ch2 = str2.ToCharArray();
int cnt = 0;
for (int i = 0; i < ch.Length / 2; i++) {
cnt = 0;
if (ch2[0] == ch[i]) {
for (int j = 0; j < ch2.Length; j++) {
if (ch2[0 + j] == ch[i + j]) {
cnt++;
}
}
if (cnt == ch2.Length) {
Console.WriteLine("Yes");
return;
}
}
}
Console.WriteLine("No");
}
}
|
[["+", 0, 7, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 8, 196, 0, 1, 0, 11, 0, 202, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 11, 12, 203], ["+", 8, 196, 0, 7, 8, 196, 0, 1, 0, 35], ["-", 0, 57, 64, 196, 0, 57, 15, 16, 17, 20], ["+", 0, 57, 64, 196, 0, 57, 15, 16, 17, 60]]
| 8
| 166
| 6
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ITP1_8_D {
class Program {
static void Main(string[] args) {
var target = Console.ReadLine();
var word = Console.ReadLine();
target = target + target.Substring(0, word.Length - 1);
// var find = target.Contains(word);
// Console.WriteLine(find ? "Yes" : "No");
var index = 0;
for (var h = 0; h < (target.Length - word.Length - 1); ++h) {
index = 0;
for (var i = 0; i < word.Length; ++i) {
if (target[h + i] != word[index]) {
break;
}
++index;
}
if (index == word.Length) {
break;
}
}
Console.WriteLine((index == word.Length) ? "Yes" : "No");
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ITP1_8_D {
class Program {
static void Main(string[] args) {
var target = Console.ReadLine();
var word = Console.ReadLine();
target = target + target.Substring(0, word.Length - 1);
// var find = target.Contains(word);
// Console.WriteLine(find ? "Yes" : "No");
var index = 0;
for (var h = 0; h < (target.Length - word.Length + 1); ++h) {
index = 0;
for (var i = 0; i < word.Length; ++i) {
if (target[h + i] != word[index]) {
break;
}
++index;
}
if (index == word.Length) {
break;
}
}
Console.WriteLine((index == word.Length) ? "Yes" : "No");
}
}
}
|
[["-", 0, 7, 15, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 72]]
| 8
| 183
| 2
|
using System;
namespace ConsoleApplication43 {
class Program {
static void Main(string[] args) {
string s = Console.ReadLine();
string p = Console.ReadLine();
string ss = s + s;
int a = 0;
for (int i = 0; i < s.Length; i++) {
if (p[0].Equals(ss[i])) {
if (s.Length > (i + p.Length - 1)) {
string S1 = ss.Substring(i, p.Length);
if (p.Equals(S1)) {
a += 1;
break;
}
}
}
}
if (a > 0) {
Console.WriteLine("Yes");
} else {
Console.WriteLine("No");
}
}
}
}
|
using System;
namespace ConsoleApplication43 {
class Program {
static void Main(string[] args) {
string s = Console.ReadLine();
string p = Console.ReadLine();
string ss = s + s;
int a = 0;
for (int i = 0; i < s.Length; i++) {
if (p[0].Equals(ss[i])) {
if (ss.Length > (i + p.Length - 1)) {
string S1 = ss.Substring(i, p.Length);
if (p.Equals(S1)) {
a += 1;
break;
}
}
}
}
if (a > 0) {
Console.WriteLine("Yes");
} else {
Console.WriteLine("No");
}
}
}
}
|
[["-", 64, 196, 0, 57, 15, 16, 31, 214, 205, 22], ["+", 64, 196, 0, 57, 15, 16, 31, 214, 205, 22]]
| 8
| 165
| 2
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.