Search is not available for this dataset
name
stringlengths
2
88
description
stringlengths
31
8.62k
public_tests
dict
private_tests
dict
solution_type
stringclasses
2 values
programming_language
stringclasses
5 values
solution
stringlengths
1
983k
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <stdio.h> int main(void) { int t[4]; int n[4]; int i; for(i=0;i<4;i++) scanf("%d %d",&t[i],&n[i]); for(i=0;i<4;i++){ switch(v[i])} case 1:t[i]=6000; break; case 2:t[i]=4000; break; case 3:t[i]=3000; break; case 4:t[i]=2000: break; } } for(i=0;i<4;i++) printf("%d\n",t[i]*n[i]); return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); int t; int n; int kingaku; public void kei(){ t = sc.nextInt(); n = sc.nextInt(); switch(t){ case 1: kingaku = 6000 * n; break; case 2: kingaku = 4000 * n; break; case 3: kingaku = 3000 * n; break; case 4: kingaku = 2000 * n; break; } } public void hyouji(){ System.out.println(kingaku); } /** * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Main go = new Main(); go.kei(); go.hyouji(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int data[] = {6000, 4000, 3000, 2000}; for (int i = 0; i < 4; i++) { int t, n; scanf("%d %d", &t, &n); printf("%d\n", data[t] * n); } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
public class Main { public static void main(String[] args) { int k; int []intake = new int[4]; int inatai; int []atai={3,1,4,2}; int []maisu={10,4,1,5}; for(k=0;k<=4;k++){ switch(atai[k]){ case 1:inatai = 6000*maisu[k];break; case 2:inatai = 4000*maisu[k];break; case 3:inatai = 3000*maisu[k];break; case 4:inatai = 2000*maisu[k];break; inatai = intake[k]; System.out.println(atai[k]); System.out.println(maisu[k]); System.out.println(intake[k]); } } } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
/* ファイル名:問題2 2712 影山加純 */ import java.util.Scanner; class Main2{ int tiket[]={0,6000,4000,3000,2000}; int t,n,uriage; public void solve(){ Scanner sc=new Scanner(System.in); for(int i=0;i<4;i++){ t=sc.nextInt(); n=sc.nextInt(); uriage=tiket[t]*n; System.out.println(uriage); } } public static void main(String[]args){ Main2 obj=new Main2(); obj.solve(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <bits/stdc++.h> int main(void) { int t[4]; int n[4]; int i; for (i = 0; i < 4; i++) scanf("%d %d", &t[i], &n[i]); for (i = 0; i < 4; i++) { if (t[i] == 1) t[i] = 6000; if (t[i] == 2) t[i] = 4000; if (t[i] == 3) t[i] = 3000; if (t[i] == 4) t[i] = 1000; } for (i = 0; i < 4; i++) printf("%d\n", t[i] * n[i]); return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int sum = 0; int koka[] = {1, 5, 10, 50, 100, 500}; int c; for (int i = 0; i < 6; i++) { int c; cin >> c; sum += c * koka[i]; } if (sum >= 1000) { cout << "1" << endl; } else { cout << "0" << endl; } cout << (sum >= 1000 ? "1" : "0") << endl; return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int ticket[] = {6000, 4000, 3000, 2000}; for (int i = 0; i < 7; i++) { int t, n; cin >> t >> n; cout << ticket[t - 1] * n << endl; } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <stdio.h> int main(void) { int t[4]; int n[4]; int i; for(i=0;i<4;i++) scanf("%d %d",&t[i],&n[i]); for(i=0;i<4;i++){ switch(t[i]){ case 1:t[i]=6000; break; case 2:t[i]=4000; break; case 3:t[i]=3000; break; case 4:t[i]=2000: break; } } for(i=0;i<4;i++) printf("%d\n",t[i]*n[i]); return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { vector<pair<int, int>> price; for (int i = 0; i < 4; ++i) { int a, b; cin >> a; cin >> b; price.push_back(make_pair(a, b)); } int sabc; for (pair<int, int> e : price) { if (e.first == 1) { sabc = 6000 * e.second; } else if (e.first == 2) { sabc = 4000 * e.second; } else if (e.first == 3) { sabc = 3000 * e.second; } else if (e.first == 4) { sabc = 2000 * e.second; } cout << sabc << endl; } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; ostream& _ost = cout; template <class T> ostream& operator,(ostream& ost, const T& value) { return ost << value << ","; } ostream& operator~(ostream& ost) { return ost << endl; } template <class T> string tos(const T& var) { ostringstream ss; ss << var; return ss.str(); } const int mod = 1000000007; const int INF = 1000000; const double EPS = 1e-10; int m, n; int dp[1][1]; int main() { cin >> n; for (int i = (0); i < (n); i++) { int x, y, b, p; cin >> x >> y >> b >> p; if (b >= 5 && p >= 2) { cout << (x * b + y * p) * 0.8 << endl; } else { if (b >= 5) { cout << min(1.0 * x * b + y * p, (x * b + y * 2) * 0.8) << endl; } else { cout << min(1.0 * x * b + y * p, (x * 5 + y * p) * 0.8) << endl; } } } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <bits/stdc++.h> int main(void) { int seki[5], t, n; seki[1] = 6000; seki[2] = 4000; seki[3] = 3000; seki[4] = 2000; scanf("%d %d", &t, &n); printf("%d\n", seki[t] * n); return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; class Main{ public void open(){System.out.println("Open");} public void close(){System.out.println("Close");} public void run(){ Scanner sc = new Scanner(System.in); String state = sc.nextLine(); if(state.equals("1 0 0"))close(); else if(state.equals("0 1 0"))close(); else if(state.equals("1 1 0"))open(); else if(state.equals("0 0 1"))open(); else if(state.equals("0 0 0"))close(); } public static void main(String[] args){new Main().run();} }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); int[] kingaku = new int [4]; int n; public void syurui(){ for(n = 0;n <= 3;n++){ int syurui = sc.nextInt(); int maisu = sc.nextInt(); int kane; switch(syurui){ case 1: kane = 2000; kingaku[n] = kane * maisu; break; case 2: kane = 3000; kingaku[n] = kane * maisu; break; case 3 : kane = 4000; kingaku[n] = kane * maisu; break; case 4 : kane = 6000; kingaku[n] = kane * maisu; break; } } } public void hyouji(){ for(n = 0;n <= 3;n++){ System.out.println(kingaku[n]); } } public static void main(String[] args) { Main toi = new Main(); toi.syurui(); toi.hyouji(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); int kingaku; int[] goukei = new int[4]; int n; public void syurui(){ for (n = 0; n <= 3;n++){ int syurui = sc.nextInt(); int maisuu = sc.nextInt(); switch(syurui){ case 1: kingaku = 6000;break; case 2: kingaku = 4000;break; case 3: kingaku = 3000;break; case 4: kingaku = 2000;break; } goukei[n] = kingaku * maisuu;} } public void hyouji(){ for(n = 0; n < 3; n++){ System.out.println(goukei[n]); } } public static void main(String[] args) { Main m = new Main(); m.syurui(); m.hyouji(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int a[] = {6000, 4000, 3000, 2000}; int k[4] = {0}; for (int i = 0; i < 4; i++) { int x, y; cin >> x >> y; k[x - 1] += a[x - 1] * y; } for (int i = 0; i < 4; i++) { cout << k[i] << endl; } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
//2731松平 愛実 import java.util.Scanner; class Main{ int seki; int maisu; int cnt=0; public void solve(){ Scanner sc = new Scanner(System.in); seki = sc.nextInt(); maisu = sc.nextInt(); while(cnt<4){ switch(seki){ case 1: seki=6000; break; case 2: seki=4000; break; case 3: seki=3000; break; case 4: seki=2000; break; } cnt++; System.out.println(seki*maisu); seki = sc.nextInt(); } } public static void main(String[]args){ Main obj = new Main(); obj.solve(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; template <class T> void debug(T a) { for (auto iiiiiiiiii : a) cout << iiiiiiiiii << endl; } int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; int main() { int d[] = {0, 6000, 4000, 3000, 2000}; int ans = 0; for (int i = 0; i < (int)4; i++) { int t, n; cin >> t >> n; ans += d[t] * n; } cout << ans << endl; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include<stdio.h> int main(void) { int t,n,i,Sseki,Aseki,Bseki,Cseki; for(i=1;i<5;i++){ scanf("%d%d",&t,&n); swich (t) { case 1: Sseki=6000*n; break; case 2: Aseki=3000*n; break; case 3: Bseki=3000*n; break; case 4: Cseki=2000*n; break; } if(t==1){ printf("%d\n",Sseki); } else if(t==2){ printf("%d\n",Aseki); } else if(t==3){ printf("%d\n",Bseki); } else{ printf("%d\n",Cseki); } } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
package a2; import java.util.Scanner; public class Main { /** * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int[] sa = new int[7]; for(int i=0;i<4;i++){ int a = sc.nextInt(); int b = sc.nextInt(); switch (a){ case 1: sa[0]+=6000*b; case 2: sa[1]+=4000*b; case 3: sa[2]+=3000*b; case 4: sa[3]+=2000*b; } ; } for(int i = 0;i<4;i++){ System.out.println(sa[i]); } } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); int kingaku; int[] goukei = new int[4]; int n; public void syurui(){ for(n=0;n<=3;n++){ int syurui = sc.nextInt(); int maisuu = sc.nextInt(); switch (syurui){ case 1: kingaku = 6000;break; case 2: kingaku = 4000;break; case 3: kingaku = 3000;break; case 4: kingaku = 2000;break; } goukei[n] = kingaku * maisuu; } } public void hyouji(){ for(n=0;n<=3;n++){ System.out.println(goukei[n]); } } public static void main(String[] args) { Main Main = new Main(); Main.syurui(); Main.hyouji(); }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
data = Array.new(4) i = 0 #p data =begin File.open("test/0277","r") do |input| while data[i] = input.gets do #p data[i] i += 1 end end =end while data[i] = input.gets do #p data[i] i += 1 end for i in data if i == nil break end a,b = (i.chomp).split(" ").map(&:to_i) case a when 1 a = 6000 when 2 a = 4000 when 3 a = 3000 when 4 a = 2000 end p a*b end
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include<iostream> using namespace std; int main(){ int a,b; for(int i=0;i<4;i++) cin>>a>>b; if(a==1) cout<<b*6000<<endl; if(a==2) cout<<b*4000<<endl;; if(a==3) cout<<b*3000<<endl; if(a==4) cout<<b*2000<<endl; } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); int t; int n; int kingaku; int tanka; public void kei(){ t = sc.nextInt(); n = sc.nextInt(); switch(t){ case 1:tanka = 6000; break; case 2:tanka = 4000; break; case 3:tanka = 3000; break; case 4:tanka = 2000; break; } } public void hyouji(){ kingaku = tanka * n; System.out.println(kingaku); } /** * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Main go = new Main(); go.kei(); go.hyouji(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> int main() { int a = 0, b = 0; for (int i = 0; i < 4; i++) { scanf("%d%d", &a, &b); switch (a) { case 1: printf("%d", b * 6000); break; case 2: printf("%d", b * 4000); break; case 3: printf("%d", b * 3000); break; default: printf("%d", b * 2000); break; } } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> int main(void) { int t, n, t1, n1, t2, n2, t3, n3, t4, n4; scanf("%d", &t1); t1 = 6000; scanf("%d", &n1); scanf("%d", &t2); t2 = 4000; scanf("%d", &n2); scanf("%d", &t3); t3 = 3000; scanf("%d", &n3); scanf("%d", &t4); t4 = 2000; scanf("%d", &n4); printf("%d\n", t1 * n1); printf("%d\n", t2 * n2); printf("%d\n", t3 * n3); printf("%d\n", t4 * n4); return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <iostream> using namespace std; int A[4],B[4],C[4]; int main(){ cin >>A[0]>>B[0]>>A[1]>>B[1]>>A[2]>>B[2]>>A[3]>>B[3]; for(int i = 0; i < 4; i++){ if(A[i]==1){ C[i]=6000*B[i]; }else if(A[i]==2){ C[i]=4000*B[i]; }else if(A[i]==3){ C[i]=3000*B[i]; }else{ C[i]=2000*B[i]; } } cout <<C[0]<<endl<<C[1]<<endl<<C[2]<<endl<<C[3]<endl; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int a[] = {6000, 4000, 3000, 2000}; long long k[4] = {0}; for (int i = 0; i < 4; i++) { int x, y; cin >> x >> y; k[x - 1] += a[x - 1] * y; } for (int i = 0; i < 4; i++) { cout << k[i] << endl; } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main{ int t,n; public void solve(){ Scanner sc = new Scanner(System.in); while(t <= 4 && n <= 10000){ t = sc.nextInt(); n = sc.nextInt(); if(t == 1){ System.out.println(6000*n); }else if(t == 2){ System.out.println(4000*n); }else if(t == 3){ System.out.println(3000*n); }else if(t == 4){ System.out.println(2000*n); } } } public static void main(String[] args){ Main obj = new Main(); obj.solve(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace id_0277cs { class Program { static void Main(string[] args) { foreach( var i in Enumerable.Range(0, 4)) { var vs = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray(); var t = vs[0]; var n = vs[1]; if(t == 1) { Console.WriteLine(n * 6000); } if(t == 2) { Console.WriteLine(n * 4000); } if(t == 3) { Console.WriteLine(n * 3000); } if(t == 4) { Console.WriteLine(n * 2000); } } } } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; class Main2{ int tiket[]={0,6000,4000,3000,2000}; int t,n,uriage; public void solve(){ Scanner sc=new Scanner(System.in); for(int i=0;i<4;i++){ t=sc.nextInt(); n=sc.nextInt(); uriage=tiket[t]*n; System.out.println(uriage); } } public static void main(String[]args){ Main2 obj=new Main2(); obj.solve(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k; int []intake = new int[4]; int inatai; int atai=sc.nextInt(); int maisu=sc.nextInt(); for(k=0;k<=4;k++){ switch(atai){ case 1:inatai = 6000*maisu;break; case 2:inatai = 4000*maisu;break; case 3:inatai = 3000*maisu;break; case 4:inatai = 2000*maisu;break; System.out.println(atai); System.out.println(maisu); System.out.println(inatai); } } } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include<stdio.h> int main() { int i; int n; int prices[] = {6000, 4000, 3000, 2000}; unsigned long long int sums[4]; for (i=0; i<4; i++) { int ind; unsigned long long int times; scanf("%d %llu", &ind, &times); sum[ind-1] = prices[ind-1] * times; } for (i=0; i<4; i++) { printf("%llu\n", sums[i]); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include<stdio.h> int main(void) { int t[4],i,n[4],pokemon[4]; for(i=0;i<4;i++){ scanf("%d %d",&t[i],&n[i]); if(1==t){ pokemon[i]=6000*n;} else if(2==t){ pokemon[i]=4000*n;} else if(3==t){ pokemon[i]=3000*n;} else{ pokemon[i]=2000*n;} } for(i=0;i<4;i++){ printf("%d\n",pokemon[i]);} return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int tick, n; int temp[5] = {0, 6000, 4000, 3000, 2000}; for (int i = 0; i < 4; i++) { cin >> tick >> n; cout << temp[tick] * n; } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int sum = 0, m, n; int price[4] = {6000, 4000, 3000, 2000}; for (int i = 0; i < 4; i++) { cin >> m >> n; cout << price[m] * n << endl; } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <bits/stdc++.h> int main() { int a, b, c = 0; int out[4]; while (c < 4) { scanf("%d %d", &a, &b); if (a == 1) { out[c] = 6 * b; } else if (a == 2) { out[c] = 4 * b; } else if (a == 3) { out[c] = 3 * b; } else { out[c] = 2 * b; } c++; } for (c = 0; c < 4; c++) printf("%d000\n", out[c]); return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main{ public void solve(){ Scanner sc = new Scanner(System.in); int syu,mai,a,uri; for(int t=0; t<4; t++){ syu = sc.nextInt; if(syu==1){ a=6000; }else if(syu==2){ a=4000; }else if(syu==3){ a=3000; }else if(syu==4){ a=2000; } mai = sc.nextInt(); uri = a * mai; System.out.println(uri); } } public static void main(String[] args){ Main obj = new Main(); obj.solve(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int[] sell = new int[5]; int t,n; for(int i=0;i<4;i++){ t=sc.nextInt(); n=sc.nextInt(); sell[t]=n; } int[] p = {0,6,4,3,2}; for(int i=1;i<5;i++){ System.out.println(p[i]*sell[i]*1000); } } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
python2
while t,n=map(input,raw_input().split()): list=[0,0,0,0] if(t==1): list[t-1]+=n*6000 if(t==2): list[t-1]+=n*4000 if(t==3): list[t-1]+=n*3000 if(t==4): list[t-1]+=n*2000 for i in range(0,4): print list[i]
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <bits/stdc++.h> int main(void) { int t, n, d, cnt = 1; while (cnt < 4) { scanf("%d %d", &t, &n); if (t == 1) d = 6000 * n; else if (t == 2) d = 4000 * n; else if (t == 3) d = 3000 * n; else d = 2000 * n; printf("%d\n", d); } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; class Main { public static void main(String args[]) { Scanner scan=new Scanner(System.in); int s[]=new int[4]; while(scan.hasNext()) { int t=scan.nextInt(); int n=scan.nextInt(); if(t==1)s[t-1]+=6000*n; if(t==2)s[t-1]+=4000*n; if(t==3)s[t-1]+=3000*n; if(t==4)s[t-1]+=2000*n; } for(int i=0;i<4;i++) { System.out.println(s[i]); } } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <stdio.h> int main(void) { int t[4]; int n[4]; int i; for(i=0;i<4;i++) scanf("%d %d",&t[i],&n[i]); for(i=0;i<4;i++){ switch(t[i])} case 1:t[i]=6000; break; case 2:t[i]=4000; break; case 3:t[i]=3000; break; case 4:t[i]=2000: break; } } for(i=0;i<4;i++) printf("%d\n",t[i]*n[i]); return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <bits/stdc++.h> int main(void) { int t, n, d[4], cnt = 1; while (cnt < 4) { scanf("%d %d", &t, &n); if (t == 1) d[cnt] = 6000 * n; else if (t == 2) d[cnt] = 4000 * n; else if (t == 3) d[cnt] = 3000 * n; else d[cnt] = 2000 * n; cnt++; } while (cnt != 4) printf("%d\n", d[cnt]); return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; class exe0277 { public static void main(String args[]) { Scanner scan=new Scanner(System.in); int s[]=new int[4]; for(int i=0;i<4;i++) { int t=scan.nextInt(); int n=scan.nextInt(); if(t==1)s[i]+=6000*n; if(t==2)s[i]+=4000*n; if(t==3)s[i]+=3000*n; if(t==4)s[i]+=2000*n; } for(int i=0;i<4;i++) { System.out.println(s[i]); } } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
using System; class Program { static void Main() { for (int i = 0; i < 4; i++) { int[] tickets = { 6000, 4000, 3000, 2000 }; var strs = Console.ReadLine().Split(' '); Console.WriteLine(tickets[int.Parse(strs[0]) - 1] * int.Parse(strs[1])); } } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
data = Array.new(4) i = 0 #p data while data[i] = gets do #p data[i] i += 1 end p data for i in data if i == nil break end a,b = (i.chomp).split(" ").map(&:to_i) case a when 1 a = 6000 when 2 a = 4000 when 3 a = 3000 when 4 a = 2000 end p a*b end
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <iostream> using namespace std; int main () { int t; int n; int result; for (int i = 0; i < 4; i++) { cin >> t >> n; switch (t) { case 1: result = 6000 * n; return; case 2: result = 4000 * n; return; case 3: result = 3000 * n; return; case 4: result = 2000 * n; return; } cout << result << endl; } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <iosream> using namespace std; int A[4],B[4],C[4]; int main(){ cin >>A[0]>>B[0]>>A[1]>>B[1]>>A[2]>>B[2]>>A[3]>>B[3]; for(int i = 0; i < 4; i++){ if(A[i]==1){ C[i]=6000*B[i]; }else if(A[i]==2){ C[i]=4000*B[i]; }else if(A[i]==3){ C[i]=3000*B[i]; }else{ C[i]=2000*B[i]; } } cout <<C[0]<<endl<<C[1]<<endl<<C[2]<<endl<<C[3]<endl; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include<stdio.h> int main(void) { int i,t,n,k; for(i=0;i>4;i++){ scanf("%d %d",&t,&n); if(t==1){ k=6000; } else{ k=(6-t)*1000; } k*=n; printf("%d\n",k) } return(0); }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <bits/stdc++.h> int main(void) { int t, n, d[4], cnt = 0; while (cnt != 3) { scanf("%d %d", &t, &n); if (t == 1) d[cnt] = 6000 * n; else if (t == 2) d[cnt] = 4000 * n; else if (t == 3) d[cnt] = 3000 * n; else d[cnt] = 2000 * n; cnt++; } cnt = 0; while (cnt != 3) printf("%d\n", d[cnt]); return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
a;main(b){for(;a=~scanf("%d%d",&a,&b);printf("%d\n",(int)((6-a)*1.2)*1000*b));}
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> int c[] = {0, 6000, 4000, 3000, 2000}; int main() { int ret = 0; for (int i = 0; i < 4; i++) { int a, b; scanf("%d%d", &a, &b); ret += c[a] * b; } printf("%d\n", ret); }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#encoding:utf-8 No.0277 2014.11.10 sale = Array.new while true if (data = gets.chomp.split.map{|elem| elem.to_i}) == [] break end sale.push data end sale.each do |i| if i[0] == 1 puts 6000*i[1] elsif i[0] == 2 puts 4000*i[1] elsif i[0] == 3 puts 3000*i[1] else i[0] == 4 puts 2000*i[1] end end
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
using System; using System.Linq; using System.Collections.Generic; namespace ConsoleApplication1 { class ClassMain { public static void Main(String[] args) { //string line; int[] uriage = new int[5]; for (int i = 0; i < 4; i++) { int[] ints = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); if(ints[0]==1){ uriage[1] += 6000 * ints[1]; } if (ints[0] == 2) { uriage[2] += 4000 * ints[1]; } if (ints[0] == 3) { uriage[3] += 3000 * ints[1]; } if (ints[0] == 4) { uriage[4] += 2000 * ints[1]; } Console.WriteLine(uriage[1]); Console.WriteLine(uriage[2]); Console.WriteLine(uriage[3]); Console.WriteLine(uriage[4]); } /*while ((line = Console.ReadLine()) != null) { int[] ints = line.Split(' ').Select(int.Parse).ToArray(); int n = ints[0]; //int n = int.Parse(line); if (n == 0) { break; } int m = ints[1]; Console.WriteLine(n - m); int k = 6; while (k-- > 0) { ints = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); n = ints[0]; m = ints[1]; Console.WriteLine(n - m); } break; }*/ } } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Q0277{ public void solve(){ Scanner sc = new Scanner(System.in); int ninzu,k; int ban; for(int i=0;i<4;i++){ ban = sc.nextInt(); if(ban == 1){ k = 6000; }else if(ban == 2){ k = 4000; }else if(ban == 3){ k = 3000; }else{ k = 2000; } ninzu = sc.nextInt(); int uriage = k*ninzu; System.out.println(uriage); } } public static void main(String[] args){ Q0277 obj = new Q0277(); obj.solve(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <iostream> using namespace std; int main () { int t; int n; int result; for (int i = 0; i < 4; i++) { cin >> t >> n; switch (t) { case 1: result = 6000 * n; return; case 2: result = 4000 * n; return; case 3: result = 3000 * n; return; case 4: result = 2000 * n; return; } cout << result << endl(); } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Tiket{ Scanner sc = new Scanner(System.in); int nban,nsyu; public void handan(){ for(int i = 0; i<4; i++){ nsyu = sc.nextInt(); nban = sc.nextInt(); switch (nsyu){ case 1: System.out.println(nban*6000);break; case 2: System.out.println(nban*4000);break; case 3: System.out.println(nban*3000);break; case 4: System.out.println(nban*2000);break; } } } /** * @param args */ public static void main(String[] args) { Tiket t = new Tiket(); t.handan(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <bits/stdc++.h> int main() { int a, b, c = 0; int out[4]; while (c < 4) { scanf("%d %d", &a, &b); if (a == 1) { out[c] = 6 * b; } else if (a == 2) { out[c] = 4 * b; } else if (a == 3) { out[c] = 3 * b; } else { out[c] = 2 * b; } c++; } for (c = 0; c < 4; c++) if (!out[c]) printf("%d000\n", out[c]); else puts("0"); return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); int kode,mai,a; int[] kin ={6000,4000,3000,2000}; int[] gou = new int[4]; public void keisan(){ System.out.println("チケットの種類と枚数を入力してください"); for(a=0;a<=3;a++){ kode = sc.nextInt(); mai = sc.nextInt(); switch(kode){ case 1: gou[a] += kin[kode - 1] * mai; break; case 2: gou[a] += kin[kode - 1] * mai; break; case 3: gou[a] += kin[kode - 1] * mai; break; case 4: gou[a] += kin[kode - 1] * mai; break; } } } public void hyouji(){ for(a=0;a<=3;a++){ System.out.println(gou[a]); } } public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Main go = new Main(); go.keisan(); go.hyouji(); } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
class Main{ public void run(){ Scanner sc = new Scanner(System.in); for( int i = 0; i < 4; i++){ int nType = sc.nextLine(); int nNum = sc.nextLine(); switch(nType){ case 1: System.out.println(6000*nNum); break; case 2: System.out.println(4000*nNum); break; case 3: System.out.println(3000*nNum); break; case 4: System.out.println(2000*nNum); break; } } } public static void main(String[] args){ new Main().run();} }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int pr[4] = {6000, 4000, 3000, 2000}; int a, b; for (int i = 0; i < 7; i++) { cin >> a >> b; cout << pr[a - 1] * b << endl; } }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include<stdio.h> int main(){ int i,input,a[4],b; for(i=0;i<4;i++){ scanf("%d%d",&input,&); case (input){ case 1: a[i]=6000*b; case 2: a[i]=4000*b; case 3: a[i]=3000*b; case 4: a[i]=2000*b; } } for(i=0;i<4;i++){ printf("%d\n",a[i]); } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> int main() { int a, b, c, i; for (i = 1; i <= 7; i++) { scanf("%d %d", &a, &b); if (a == 1) { c = 6000 * b; } else if (a == 2) { c = 4000 * b; } else if (a == 3) { c = 3000 * b; } else if (a == 4) { c = 2000 * b; } printf("%d\n", c); } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { vector<int> v(5); for (int i = 0; i < 4; i++) { int hoge, tyome; cin >> hoge >> tyome; v[hoge] = tyome; } cout << v[1] * 6000 << "\n" << v[2] * 4000 << "\n" << v[3] * 3000 << "\n" << v[4] * 2000 << endl; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
int main(){ int t,n; int aka[5]={0}; int i; for(i=0;i<4;i++){ cin>>t>>n; if(t==1){ aka[i]=6000*n; } else if(t==2){ aka[i]=4000*n; } else if(t==3){ aka[i]=3000*n; } else{ aka[i]=2000*n; } } for(i=0;i<4;i++){ cout<<aka[i]<<endl; } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <bits/stdc++.h> int main(void) { int t, n, i, g; for (i = 0; i < 4; i++) { scanf("%d%d", &t, &n); if (t == 1) { g = 6000 * n; printf("%d", g); } else if (t == 2) { g = 4000 * n; printf("%d", g); } else if (t == 3) { g = 3000 * n; printf("%d", g); } else if (t == 4) { g = 2000 * n; printf("%d", g); } } return 0; }
p00272 Ticket Sales
Today is the ticket release date for Aizu Entertainment's recommended idol group "Akabeko & Koboushi". There are four types of tickets: S seat 6000 yen A seat 4000 yen B seat 3000 yen C seat 2000 yen You, the sales manager, are excitedly waiting for the launch. Finally on sale. It's selling very well! Shortly after the launch, I received a table summarizing the orders up to that point. Each row of the table shows the type and number of tickets sold so far. However, the ticket types do not always appear in the order of S, A, B, C. Create a program to find the sales amount for each row in this table. input Input data is given in the following format. t1 n1 t2 n2 t3 n3 t4 n4 The input consists of 4 lines. Line i is given the integer ti (1 ≤ ti ≤ 4) for the ticket type and the integer ni (0 ≤ ni ≤ 10000) for the number of tickets. The integers 1, 2, 3, and 4 representing the ticket types represent S seats, A seats, B seats, and C seats, respectively. Numbers from 1 to 4 always appear once as values ​​for t1, t2, t3, and t4, but they are not always given in the order of 1, 2, 3, 4. output Output the sales amount for each line. Example Input 3 10 1 4 4 1 2 5 Output 30000 24000 2000 20000
{ "input": [ "3 10\n1 4\n4 1\n2 5" ], "output": [ "30000\n24000\n2000\n20000" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); int kingaku; int[] goukei = new int[4]; int n; public void syurui(){ for (n=0; n<=3;n++){ int syurui = sc.nextInt(); int maisuu = sc.nextInt(); switch(syurui){ case 1: kingaku = 6000;break; case 2: kingaku = 4000;break; case 3: kingaku = 3000;break; case 4: kingaku = 2000;break; } goukei[n] = syurui * maisuu;} } public void hyouji(){ for(n = 0; n < 3; n++){ System.out.println(goukei[n]); } } public static void main(String[] args) { Main m = new Main(); m.syurui(); m.hyouji(); } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<cstdio> #include<cstring> #include<iostream> #include<vector> #include<algorithm> #include<string> using namespace std; int N,M,S; int dp[2][50][3001]; #define AMA (100000) int solve(){ memset(dp,0,sizeof(dp)); int now; int next; int ret = 0; dp[1][0][0]=1; for(int m=1;m<=M;m++){ now = m&1; next = now^1; memset(dp[next],0,sizeof(dp[next])); for(int id = 0;id<N*N;id++){ for(int j=0;j<S;j++){ if(!dp[now][id][j]) continue; if(j+m>S) break; // printf("dp[%d][%d][%d] = %d , %d\n",m,id,j,dp[now][id][j],j+m); if(id==N*N-1 && j+m==S) ret+=dp[now][id][j]%AMA; else { // printf("%d %d %d next = %d\n",m+1,id,j,dp[next][id][j]); dp[next][id+1][j+m] += dp[now][id][j]%AMA; dp[next][id][j] += dp[now][id][j]%AMA; } } } } return ret%AMA; } int main(){ while(1){ scanf("%d %d %d",&N,&M,&S); if(!N && !M && !S) break; printf("%d\n",solve()); } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
python3
import itertools while 1: n,m,s=map(int,input().split()) if n==0:break dp=[[0 for _ in range(s+1)] for _ in range(n*n+1)] dp[0][0]=1 for i,j in itertools.product(range(1,n*n+1),range(s+1)): if j>=i:dp[i][j]+=dp[i-1][j-i]+dp[i][j-i] if j-m>=1:dp[i][j]+=100000-dp[i-1][j-m-1] dp[i][j]%=100000 print(dp[n*n][s])
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<iostream> #include<iomanip> #include<algorithm> #include<array> #include<bitset> #include<cassert> #include<cctype> #include<cmath> #include<cstdio> #include<cstring> #include<functional> #include<limits> #include<list> #include<map> #include<numeric> #include<set> #include<stack> #include<string> #include<sstream> #include<unordered_map> #include<queue> #include<vector> using namespace std; //#define int long long using ll = long long; using ull = unsigned long long; using pii = pair<int, int>; #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define all(a) (a).begin(),(a).end() #define dump(o) {cerr<<#o<<" "<<o<<endl;} #define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;} #define INF 0x3f3f3f3f #define INFL 0x3f3f3f3f3f3f3f3fLL const int MOD = 100000; signed main() { int dp[55][3010] = {}; for (int N, M, S; cin >> N >> M >> S&&N;) { memset(dp, 0, sizeof(dp)); dp[0][0] = 1; rep(m, 1, M + 1) { rrep(i, 1, N*N + 1) { rep(j, 0, S + 1) { if (j + m > S)break; (dp[i][j + m] += dp[i - 1][j]) %= MOD; } } } cout << dp[N*N][S] << endl; } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <cfloat> #include <ctime> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include <queue> #include <numeric> #include <list> using namespace std; #ifdef _MSC_VER #define __typeof__ decltype template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; } #endif #define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it) #define all(c) (c).begin(), (c).end() #define rall(c) (c).rbegin(), (c).rend() #define popcount __builtin_popcount #define rep(i, n) for (int i = 0; i < n; ++i) template <class T> void max_swap(T& a, const T b) { a = max(a, b); } template <class T> void min_swap(T& a, const T b) { a = min(a, b); } const double EPS = 1e-10; typedef long long ll; typedef pair<int, int> pint; int main() { int n, m, s; while (scanf("%d%d%d", &n, &m, &s), n | m | s) { int nn = n * n; // dp[iˆÈ‰º‚ðŽg‚Á‚½][j(a_j‚Ü‚Å)][s] = sum|k=[1..i-1](dp[k][j-1][s-k]) static int dp[2][50][3001]; const int mod = 100000; rep (i, nn + 1) rep (j, s + 1) dp[0][i][j] = dp[1][i][j] = 0; dp[0][0][0] = 1; for (int i = 1; i <= m; ++i) { int (*prev)[3001] = dp[(i + 1) & 1]; int (*cur)[3001] = dp[i & 1]; rep (j, nn + 1) rep (k, s + 1) cur[j][k] = prev[j][k]; for (int j = nn; j > 0; --j) for (int k = s; k >= i; --k) (cur[j][k] += prev[j - 1][k - i]) %= mod; } printf("%d\n", dp[m & 1][nn][s]); } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> #include <sstream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime> #include <vector> #include <string> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <functional> #include <algorithm> using namespace std; #define rep(i,j) REP((i), 0, (j)) #define REP(i,j,k) for(int i=(j);(i)<(k);++i) #define BW(a,x,b) ((a)<=(x)&&(x)<=(b)) #define ALL(v) (v).begin(), (v).end() #define LENGTHOF(x) (sizeof(x) / sizeof(*(x))) #define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b) #define SQ(x) ((x)*(x)) #define Mod(x, mod) (((x)+(mod)%(mod)) #define MP make_pair #define PB push_back #define Fi first #define Se second #define INF (1<<29) #define EPS 1e-10 #define MOD 1000000007 typedef pair<int, int> pi; typedef pair<int, pi> pii; typedef vector<int> vi; typedef queue<int> qi; typedef long long ll; int N,M,S; int dp[64][3005]; int main(){ while(scanf("%d%d%d", &N,&M,&S) && N||M||S){ memset(dp, 0, sizeof dp); dp[0][0] = 1; for(int i=1;i<=M;i++){ for(int j=SQ(N);j>=0;j--){ for(int s=0;s+i<=S;s++){ dp[j+1][s+i] = (dp[j+1][s+i] + dp[j][s])%100000; } } } printf("%d\n", dp[SQ(N)][S]); } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <bits/stdc++.h> #define int long long #define endl '\n' #define FOR(i, a, n) for (int i = (a); i < (n); ++i) #define REP(i, n) FOR(i, 0, n) using namespace std; const int MOD = 100000; int N, M, S; int dp[50][3010]; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); while (cin >> N >> M >> S, N) { const int K = N * N; memset(dp, 0, sizeof(dp)); dp[0][0] = 1; REP(i, M) { for (int j = K - 1; j >= 0; --j) { for (int k = S; k >= 0; --k) { if (!dp[j][k]) continue; if (k + i + 1 <= S) (dp[j + 1][k + i + 1] += dp[j][k]) %= MOD; } } } cout << dp[K][S] << endl; } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> #include <vector> using namespace std; const int MOD = 100000; int main() { while (true) { int n, numLimit, sum; cin >> n >> numLimit >> sum; if (n == 0)break; n *= n; vector<vector<int>> dp(n + 1, vector<int>(sum + 1)); dp[0][0] = 1; for (int nowNum = 1; nowNum <= numLimit; nowNum++) { for (int backCount = n - 1; backCount >= 0; backCount--) { for (int backSum = sum - nowNum; backSum >= 0; backSum--) { dp[backCount + 1][backSum + nowNum] += dp[backCount][backSum]; dp[backCount + 1][backSum + nowNum] %= MOD; } } } cout << dp[n][sum] << endl; } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<iostream> #include<algorithm> using namespace std; #define reps(i,b,n) for(int i = b ; i < n ; ++i ) #define rep(i,n) reps(i,0,n) #define INF (1 << 30) #define MOD 100000 int dp[51][3001],N,M,S; int main(){ while(cin >> N >> M >> S , N){ fill_n(dp[0],51*3001,0); dp[0][0] = 1; for(int i = 1 ; i <= M ; i++ ){ for(int j = N * N ; j > 0 ; j-- ){ for(int k = i ; k <= S ; k++ ){ dp[j][k] = (dp[j][k] + dp[j-1][k-i]); if(dp[j][k] >= MOD) dp[j][k] -= 100000; } } } cout << dp[N*N][S] << endl; } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> #include <string> #include <vector> #include <cstdlib> #include <cstdio> #include <cmath> #include <algorithm> #include <map> #include <stack> #include <queue> #include <set> #include <cstring> using namespace std; // ascending order #define vsort(v) sort(v.begin(), v.end()) // descending order #define vsort_r(v) sort(v.begin(), v.end(), greater<int>()) #define vunique(v) unique(v.begin(), v.end()) #define mp make_pair #define ts(x) to_string(x) #define rep(i, a, b) for(int i = (int)a; i < (int)b; i++) #define repm(i, a, b) for(int i = (int)a; i > (int)b; i--) #define bit(a) bitset<8>(a) #define des_priority_queue priority_queue<int, vector<int>, greater<int> > #define all(v) (v).begin(), (v).end() typedef long long ll; typedef pair<int, int> P; const ll INF = 1e18; int main(){ cin.tie(0); ios::sync_with_stdio(false); vector<ll> rsl; int mod = 100000; while(true) { int N, M, S; cin >> N >> M >> S; if(N == 0 and M == 0 and S == 0) break; int k = N * N; int n = S - k * (k + 1) / 2; int m = M - k; ll dp[k + 1][n + 1]; memset(dp, 0, sizeof(dp)); dp[0][0] = 1; rep(i, 1, k + 1) rep(j, 0, n + 1) { if(j - i >= 0) { dp[i][j] = (dp[i - 1][j] + dp[i][j - i]) % mod; if(j - i - m >= 0) (dp[i][j] -= dp[i - 1][j - i - m]) %= mod; } else dp[i][j] = dp[i - 1][j]; } rsl.push_back(dp[k][n]); } rep(i, 0, rsl.size()) cout << rsl[i] << endl; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
/* 剰余取り忘れてしもたwガハハw */ #include <stdio.h> #include <string.h> int dp[50][3001]; int main() { while (1) { int i; int n, m, s; int square; scanf("%d %d %d", &n, &m, &s); if (n == 0 && m == 0 && s == 0) { return 0; } memset(dp, 0, sizeof(dp)); square = n*n; dp[0][0] = 1; for (i=1; i<m+1; i++) { int j; for (j=s; j>=i; j--) { int k; for (k=0; k<square; k++) { dp[k+1][j] += dp[k][j-i]; dp[k+1][j] %= 100000; } } } printf("%d\n", dp[square][s]); } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <cstdio> #include <algorithm> int N, M, S; int dp[2][2001][3001]; int main() { while (true) { scanf("%d", &N); scanf("%d", &M); scanf("%d", &S); if (N == 0 && M == 0 && S == 0) { break; } for (int i = 0; i < M; i++) { for (int j = 0; j < S; j++) { if (i == j && i != 0 && j != 0) { dp[1][i][j] = 1; } else { dp[1][i][j] = 0; } } } int A = N * N; for (int n = 2; n <= A; n++) { for (int i = 1; i <= M; i++) { for (int j = 1; j <= S; j++) { if (j >= i) { dp[n % 2][i][j] = (dp[n % 2][i - 1][j - 1] + dp[(n + 1) % 2][i - 1][j - i]) % 100000; } } } } int sum = 0; for (int i = 1; i <= M; i++) { sum += dp[A % 2][i][S]; sum %= 100000; } printf("%d\n", sum); } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<stdio.h> int main() { int N,M,S,i,j,k,MOD=100000; while(scanf("%d%d%d",&N,&M,&S),N) { int dp[50][3001]={1}; for(i=M;i>0;--i) for(j=N*N;j>0;--j) for(k=S-i;k>=0;--k) { int &r=dp[j][i+k]; r=(r+dp[j-1][k])%MOD; } printf("%d\n",dp[N*N][S]); } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
python3
while True: n, m, s = map(int, input().split()) if not n: break n2 = n ** 2 dpp = [0] * (s + 1) dpp[0] = 1 for i in range(1, n2 + 1): dpn = [0] * (s + 1) for j in range(i * (i + 1) // 2, s + 1): dpn[j] += dpp[j - i] + dpn[j - i] if j - m - 1 >= 0: dpn[j] -= dpp[j - m - 1] dpn[j] %= 100000 dpp = dpn print(dpp[s])
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <cstdio> #include <algorithm> #pragma warning(disable: 4996) #define MOD 100000 #define MAX_M 2000 #define MAX_S 3000 int N, M, S; int dp[2][MAX_M + 1][MAX_S + 1]; int main() { while (true) { scanf("%d", &N); scanf("%d", &M); scanf("%d", &S); if (N == 0 && M == 0 && S == 0) { break; } for (int i = 0; i < M; i++) { for (int j = 0; j < S; j++) { if (i == j && i != 0 && j != 0) { dp[1][i][j] = 1; } else { dp[1][i][j] = 0; } } } int A = N * N; for (int n = 2; n <= A; n++) { for (int i = 0; i < M; i++) { dp[n % 2][i][0] = 0; } for (int j = 0; j < S; j++) { dp[n % 2][0][j] = 0; } for (int i = 1; i <= M; i++) { for (int j = 1; j <= S; j++) { if (n % 2 == 0) { dp[0][i][j] = (dp[0][i - 1][j - 1] + (j >= i ? dp[1][i - 1][j - i] : 0)) % MOD; } else { dp[1][i][j] = (dp[1][i - 1][j - 1] + (j >= i ? dp[0][i - 1][j - i] : 0)) % MOD; } } } } int sum = 0; for (int i = 1; i <= M; i++) { sum += dp[A % 2][i][S]; sum %= MOD; } printf("%d\n", sum); } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<bits/stdc++.h> using namespace std;int d[51][3210],n,m,s,i,j,k;int main(){while(cin>>n>>m>>s&&n){n*=n;memset(d,0,sizeof(d));d[0][0]=1;for(k=1;k<=m;k++)for(i=n;i;i--)for(j=k;j<=s;j++)d[i][j]=(d[i][j]+d[i-1][j-k])%100000;cout<<d[n][s]<<endl;}return 0;}
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<map> #include<set> #include<utility> #include<cmath> #include<cstring> #include<queue> #include<cstdio> #include<sstream> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb push_back #define mp make_pair #define all(in) in.begin(),in.end() const double PI=acos(-1); const double EPS=1e-10; const int inf=1e9; using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int,int> pii; int main(){ int n,m,s; while(cin>>n>>m>>s,n){ int N=n*n; vvi dp(N+1,vi(s+1)); dp[0][0]=1; loop(k,1,m+1)for(int i=N-1;i>=0;i--)rep(j,s){ if(j+k>s)continue; dp[i+1][j+k]+=dp[i][j]; dp[i+1][j+k]%=100000; } cout<<dp[N][s]<<endl; } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <cstdlib> #include <iostream> #include <vector> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); const int mod = 100000; for(int n, m, s; cin >> n >> m >> s, n;) { vector<vector<int> > dp(s + 1, vector<int>(n * n + 1, 0)); dp[0][0] = 1; for(int i = 1; i <= m; ++i) { for(int j = s - i; j >= 0; --j) { for(int k = 0; k < n * n; ++k) { if(dp[j][k] == 0) continue; dp[j + i][k + 1] += dp[j][k]; dp[j + i][k + 1] %= mod; } } } cout << dp[s][n * n] << endl; } return EXIT_SUCCESS; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <complex> #include <string> #include <sstream> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <functional> #include <iostream> #include <map> #include <set> using namespace std; typedef pair<int,int> P; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; #define pu push #define pb push_back #define mp make_pair #define eps 1e-9 #define INF 2000000000 #define sz(x) ((int)(x).size()) #define fi first #define sec second #define SORT(x) sort((x).begin(),(x).end()) #define all(x) (x).begin(),(x).end() #define EQ(a,b) (abs((a)-(b))<EPS) #define MOD 100000 int main() { while(1) { int dp[50][3010]; memset(dp,0,sizeof(dp)); dp[0][0]=1; int n,m,s; cin >> n >> m >> s; if(n==0&&m==0&&s==0)break; for(int i=1;i<=m;i++) { for(int j=n*n-1;j>=0;j--) { for(int k=i;k<=s;k++) { dp[j+1][k]+=dp[j][k-i]; dp[j+1][k]%=MOD; } } } cout << dp[n*n][s] << endl; } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <cstdio> #include <cstring> using namespace std; int d[50][3001]; int main() { int n,m,s; while(scanf("%d%d%d",&n,&m,&s),n) {memset(d,0,sizeof(d)); d[0][0]=1;for (int i=1;i<=m;++i)for (int j=n*n;j;--j)for (int k=s;k>=i;--k) d[j][k]=(d[j][k]+d[j-1][k-i])%100000; printf("%d\n",d[n*n][s]); } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> #include <sstream> #include <string> #include <algorithm> #include <vector> #include <map> #include <set> #include <bitset> #include <queue> #include <stack> #include <bitset> #include <utility> #include <cstring> #include <cmath> #include <cstdio> #include <cstdlib> #include <cctype> using namespace std; #define rep(i,n) for(int i=0; i<n; i++) #define repa(i,s,e) for(int i=s; i<=e; i++) #define repd(i,s,e) for(int i=s; i>=e; i--) typedef pair<int,int> pii; typedef vector<int> vi; typedef long long ll; const int MAX_N = 7; const int CSIZE = 50; const int MAX_S = 3001; int N, M, S; int dp[CSIZE][MAX_S]; void solve() { memset(dp, 0, sizeof(dp)); int n2 = N * N; dp[0][0] = 1; repa(k,1,M) { repd(i,n2,1) { repa(j,0,S) { if(j - k >= 0) { dp[i][j] += dp[i-1][j-k]; if(dp[i][j] > 100000) { dp[i][j] -= 100000; } } } } } printf("%d\n", dp[n2][S]); } int main() { while(scanf("%d%d%d", &N, &M, &S), N | M | S) { solve(); } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<cstdio> #include<cmath> #include<iostream> #include<algorithm> using namespace std; int main(){ int N,M,S; while(1){ int fie[51][3002]={0}; cin>>N>>M>>S; if(N==0&&M==0&&S==0)break; fie[0][0]=1; for(int i=1;i<=M;i++){ for(int j=N*N;0<=j;j--){ for(int k=S;0<=k;k--){ if(k+i<=3000)fie[j+1][k+i]+=fie[j][k]; fie[j][k]%=100000; } } } cout<<fie[N*N][S]%100000<<endl; } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <stdio.h> int dp[50][3333]; int dpw[50][3333]; int main() { while(1) { int n,m,s; scanf("%d %d %d",&n,&m,&s); if(n == 0) { break; } n *= n; for(int i = 0; i < n; i++) { for(int ii = 0; ii <= s; ii++) { dp[i][ii] = 0; } } for(int i = 1; i <= m; i++) { for(int ii = 0; ii < n; ii++) { for(int iii = 0; iii <= s; iii++) { dpw[ii][iii] = dp[ii][iii]; } } for(int ii = 0; ii < n - 1; ii++) { for(int iii = 0; iii < s; iii++) { if(i + iii <= s) { dpw[ii + 1][i + iii] += dp[ii][iii]; } } } dpw[0][i] += 1; for(int ii = 0; ii < n; ii++) { for(int iii = 0; iii <= s; iii++) { dp[ii][iii] = dpw[ii][iii] % 100000; } } } printf("%d\n",dp[n - 1][s]); } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; int n,m,s; int dp[55][3003]; int main(void){ while(cin >> n >> m >> s && n){ memset(dp,0,sizeof(dp)); dp[n*n][s] = 1; for(int i = 1; i <= m; i++){ for(int j = 0; j < n*n; j++){ for(int k = 0; k+i <= s; k++){ dp[j][k] += dp[j + 1][k + i]; dp[j][k] %= 100000; } } } cout << dp[0][0] << endl; } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> #include <vector> template <class T> std::vector<T> vec(int len, T elem) { return std::vector<T>(len, elem); } constexpr int MOD = 100000; bool solve() { int n, m, s; std::cin >> n >> m >> s; if (n == 0) return false; n *= n; auto dp = vec(n + 1, vec(s + 1, 0)); dp[0][0] = 1; for (int x = 1; x <= m; ++x) { for (int i = n - 1; i >= 0; --i) { for (int y = 0; y + x <= s; ++y) { dp[i + 1][y + x] += dp[i][y]; if (dp[i + 1][y + x] >= MOD) dp[i + 1][y + x] -= MOD; } } } std::cout << dp[n][s] << "\n"; return true; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); while (solve()) {} return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<iostream> #include<cstdio> using namespace std; #define LATTE 100000 int dp[2][2001][3001]; int main(){ int N,M,S; while(cin>>N>>M>>S, N||M||S){ for(int i=1;i<=M;i++)for(int j=1;j<=S;j++) dp[0][i][j]=dp[1][i][j]=0; for(int i=1;i<=M;i++){ dp[1][i][i]=1; } for(int i=1;i<N*N;i++){ for(int j=1;j<=M;j++){ for(int k=1;k<=S;k++){ //printf("%d,%d,%d\n",i,j,k); if(k+j+1<=S && j+1<=M){ dp[(i+1)&1][j+1][k+j+1] += dp[i&1][j][k]+dp[(i+1)&1][j][k+j]; dp[(i+1)&1][j+1][k+j+1]%=LATTE; } dp[i&1][j][k]=0; /*for(int l=j+1;l<=50;l++){ dp[i+1][l][k+l] += dp[i][j][k]; dp[i+1][l][k+l]%=LATTE; }*/ } } } int ans=0; for(int i=1;i<=M;i++){ ans += dp[(N*N)&1][i][S]; } printf("%d\n",ans%LATTE); } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <cmath> #include <map> #include <set> #include <stack> #include <cstdio> #include <cstdlib> #include <cstring> #define INF_LL 1e18 #define INF 1e9 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(x) x.begin(),x.end() #define fst first #define snd second using namespace std; using ll = long long; using PII = pair<int, int>; class Union_find{ private: vector<int> par; vector<int> rank; int n; public: Union_find(int a){ n = a; for(int i = 0;i < n;i++){ par.push_back(i); rank.push_back(0); } } int find(int x){ if(par[x] == x){ return x; }else{ return par[x] = find(par[x]); } } void unite(int x, int y){ x = find(x); y = find(y); if(x == y) return; if(rank[x] < rank[y]){ par[x] = y; }else{ par[y] = x; if(rank[x] == rank[y]) rank[x]++; } } bool same(int x, int y){ return find(x) == find(y); } }; int dp[2][2020][3030] = {}; int main(void){ int N, M, S; while(cin >> N >> M >> S && N && M && S){ memset(dp, 0, sizeof dp); FOR(i, 1, M+1){ dp[1][i][i] = dp[1][i-1][i] + 1; } FOR(i, 2, N*N+1){ memset(dp[i%2], 0, sizeof dp[i%2]); FOR(j, i, M+1){ FOR(k, 1, S+1){ dp[(i+1)%2][j-1][k] += dp[(i+1)%2][j-2][k]; if(k >= j){ dp[i%2][j][k] += dp[(i+1)%2][min(k, j-1)][k-j]; dp[i%2][j][k] = dp[i%2][j][k] % 100000; } } } } ll res = 0; REP(i, M+1){ res += dp[(N*N)%2][i][S]; res = res % 100000; } cout << res << endl; } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; int N, M, S; typedef long long int ll; int DP[2001][3001]; int MOD = 100000; int main() { while (true){ scanf("%d%d%d", &N, &M, &S); if (N == 0 && M == 0 && S == 0)break; for (int i = 0; i <= N*N; i++)for (int j = 0; j <=S; j++)DP[i][j] = 0; DP[0][0] = 1; for (int i = 1; i <= M; i++){ for (int j = S; j >= 0; j--){ if (j + i <= S){ for (int k = 1; k <= N*N; k++){ DP[k][j + i] = (DP[k][j + i] + DP[k - 1][j]) % MOD; } } } } int ans = 0; printf("%d\n", DP[N*N][S]%MOD); } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <bits/stdc++.h> using namespace std; const int mod = 1e5; int main() { int N, M, S; while (true) { cin >> N >> M >> S; if (N == 0) break; long long dp[N * N + 1][S + 1]; memset(dp, 0, sizeof(dp)); dp[0][0] = 1; for (int i = 1; i <= N * N; ++i) { for (int j = 0; j <= S; ++j) { if (j >= i) (dp[i][j] += dp[i][j - i] + dp[i - 1][j - i]) %= mod; if (j >= M + 1) (dp[i][j] += mod - dp[i - 1][j - (M + 1)]) %= mod; } } cout << dp[N * N][S] << endl; } return 0; }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
# include <iostream> # include <algorithm> # include <vector> # include <string> # include <set> # include <map> # include <cmath> # include <iomanip> # include <functional> # include <utility> # include <stack> # include <queue> # include <list> # include <tuple> # include <unordered_map> # include <numeric> # include <complex> using namespace std; using LL = long long; using ULL = unsigned long long; constexpr int INF = 2000000000; constexpr int HINF = INF / 2; constexpr double DINF = 100000000000000000.0; constexpr long long LINF = 9223372036854775807; constexpr long long HLINF = 4500000000000000000; const double PI = acos(-1); int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 }; # define ALL(x) (x).begin(),(x).end() # define UNIQ(c) (c).erase(unique(ALL((c))), end((c))) # define mp make_pair # define eb emplace_back # define FOR(i,a,b) for(int i=(a);i<(b);++i) # define REP(i,n) FOR(i,0,n) # define INIT std::ios::sync_with_stdio(false);std::cin.tie(0); const int MOD = 100000; LL n, m, s; LL dp[50][4005]; int main() { while ((cin >> n >> m >> s) && (n || m || s)){ n *= n; for (int i = 0; i < 50; i++)for (int j = 0; j < 4005; j++)dp[i][j] = 0; dp[0][0] = 1; for (int i = 1; i <= m; i++) { for (LL j = n; j >= 1; j--) { for (int k = i; k <= s; k++) { (dp[j][k] += dp[j - 1][k - i]) %= MOD; } } } cout << dp[n][s] << endl; } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) int main(){ int n,m,s; while(cin>>n>>m>>s&&(n||m||s)){ ll dp[51][3001] = {}; dp[0][0]=1; for(int i=1;i<=m;i++){ for(int j=n*n;j>=1;j--){ for(int k=1;k<=s;k++){ if(k-i>=0)dp[j][k] = ( dp[j][k] + dp[j-1][k-i] )%100000 ; } } } cout<<dp[n*n][s]<<endl; } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
java
import static java.util.Arrays.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { static void tr(Object... os) { System.err.println(deepToString(os)); } static final int MOD = 100000; void solve() { int N = sc.nextInt(); N = N * N; int M = sc.nextInt(); int S = sc.nextInt(); if ((N | M | S) == 0) return; int[][] dp = new int[N+1][S+1]; dp[0][0] = 1; for (int m = 1; m <= M; m++) { for (int n = N-1; n >= 0; n--) { for (int j = m; j <= S; j++) { dp[n+1][j] += dp[n][j-m]; if (dp[n+1][j] >= MOD) dp[n+1][j] -= MOD; } } } out.println(dp[N][S]); } public static void main(String[] args) throws Exception { new Main().run(); } MyScanner sc = null; PrintWriter out = null; public void run() throws Exception { sc = new MyScanner(System.in); out = new PrintWriter(System.out); for (;sc.hasNext();) { solve(); out.flush(); } out.close(); } class MyScanner { String line; BufferedReader reader; StringTokenizer tokenizer; public MyScanner(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream)); tokenizer = null; } public void eat() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { line = reader.readLine(); if (line == null) { tokenizer = null; return; } tokenizer = new StringTokenizer(line); } catch (IOException e) { throw new RuntimeException(e); } } } public String next() { eat(); return tokenizer.nextToken(); } public String nextLine() { try { return reader.readLine(); } catch (IOException e) { throw new RuntimeException(e); } } public boolean hasNext() { eat(); return (tokenizer != null && tokenizer.hasMoreElements()); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public int[] nextIntArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } } }
p00460 Bingo
problem In one programming contest, it is customary to play a bingo game at a social gathering after the competition. However, the bingo card used in this bingo game is a little special and is created according to the following conditions. * The Bingo card is divided into squares of N rows and N columns, and one positive integer is written in each square. All those integers are different. * The integer written in the square is 1 or more and M or less. * The sum of N × N integers written on the Bingo card is S. * When looking at any column, the integers are arranged in ascending order from top to bottom. * The integer in every square is larger than any integer in the column to the left of that square. The following is an example of a Bingo card when N = 5, M = 50, S = 685. <image> I want to make as many bingo cards as possible that meet the above conditions for the social gathering. However, you must not make more than one same card. Create a program that outputs the remainder of the maximum number of Bingo cards that can be created divided by 100000. input The input consists of multiple datasets. Each dataset is given in the following format. The input consists of one line, which contains the size of the bingo card N (1 ≤ N ≤ 7), the upper limit of the integers written in the square M (1 ≤ M ≤ 2000), and the bingo card. Three positive integers representing the sum of integers S (1 ≤ S ≤ 3000) are written separated by blanks. However, you can make one or more bingo cards that meet the conditions for any given input data. When N, M, S is 0, it indicates the end of input. The number of data sets does not exceed 5. output For each dataset, divide the maximum number of Bingo cards that can be created by 100000 and output the remainder on one line. Examples Input 3 9 45 3 100 50 5 50 685 0 0 0 Output 1 7 74501 Input None Output None
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<bits/stdc++.h> using namespace std; int mod=100000; int N,M,S; int dp[2001][3001]; int dpsum[2001][3001]; //int dp1[2009][3009]; int main() { while(true){ scanf("%d%d%d",&N,&M,&S); if(N==0&&M==0&&S==0)break; for(int i=0;i<=M;i++){ for(int j=0;j<=S;j++){ dp[i][j]=0;dpsum[i][j]=0; } } dp[0][0]=1; for(int i=1;i<=N*N;i++){ for(int j=i-1;j<=M;j++){ int xx=S; for(int k=i+1;k<=N*N;k++){ xx-=(j+k-i-1); } for(int k=i*(i-1)/2;k<=xx;k++){ if(j!=0){ dpsum[j][k]=dpsum[j-1][k]+dp[j][k]; if(dpsum[j][k]>=mod)dpsum[j][k]-=mod; } else{ dpsum[j][k]=dp[j][k]; } /* if(j+k+1<=S){ dp1[j+1][j+k+1]=dpsum[j][k]; }*/ //dp1[l][k+l] /* if(dp[j][k]==0)continue; for(int l=j+1;l<=M;l++){ if(k+l<=S){ dp1[l][k+l]+=dp[j][k]; if(dp1[l][k+l]>=mod)dp1[l][k+l]-=mod; } }*/ } } for(int j=0;j<=M;j++){ for(int k=j;k<=S;k++){ dp[j][k]=0; } } for(int j=0;j<=M;j++){ for(int k=0;k<=S-j-1;k++){ dp[j+1][j+k+1]=dpsum[j][k];dpsum[j][k]=0; } } /* for(int j=0;j<=M;j++){ for(int k=0;k<=S;k++){ if(dp[j][k]!=0)printf("%d %d %d:%d\n",i,j,k,dp[j][k]); } }*/ } int ans=0; for(int j=1;j<=M;j++){ //printf("") ans+=dp[j][S];ans%=mod; } printf("%d\n",ans); } return 0; }