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
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> #include <cstring> using namespace std; int dp[59][3001]; int main(void) { while(1) { int num,max,sum; cin >> num >> max >> sum; if(num+max+sum == 0) return 0; memset(dp,0,sizeof(dp)); dp[0][0] = 1; for(int m=1;m<=max;++m)//その数を使ッた時のあれ { for(int n=num*num;n>=1;--n)//どの数が使う?...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
//31 #include<iostream> #include<algorithm> using namespace std; int main(){ for(int n,m,s;cin>>n>>m>>s,n|m|s;){ int dp[2][51][3001]={{{1}}}; for(int i=1;i<=m;i++){ copy(dp[i+1&1][0],dp[(i+1&1)+1][0],dp[i&1][0]); for(int j=0;j<n*n;j++){ for(int k=0;k+i<=s;k++){ dp[i&1][j+1][k+i]=(dp[i&1][j+1...
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 posi...
{ "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 main() { int dp[50][3001]; int N, M, S; 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 = N * N; j >= 1; j--){ for (int k = S; k >= i; k--){ dp[j][...
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 posi...
{ "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> #include <cstring> #include <cstdlib> #include <cmath> #include <vector> #include <string> #include <map> #include <set> #include <queue> #include <stack> #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) #de...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include "iostream" #include "climits" #include "list" #include "queue" #include "stack" #include "set" #include "functional" #include "algorithm" #include "math.h" #include "utility" #include "string" #include "map" #include "unordered_map" #include "iomanip" #include "random" using namespace std; const long long int...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
java
import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); static int MOD = 100000; public static void main(String[] args) { while (true) { int N = sc.nextInt(); N *= N; int M = sc.nextInt(); int S = sc.nextInt(); if (N == 0) break; int[][] dp = new int[S + 1][N ...
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 posi...
{ "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 main() { int dp[55][3010]; int n,m,s; while(1){ for(int i=0;i<55;i++) for(int j=0;j<3010;j++)dp[i][j]=0; cin >> n >> m >> s; if(n==0&&m==0&&s==0)break; int bin = n*n; dp[0][0]=1; for(int k=1;k<=m;k++) ...
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 posi...
{ "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> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; int main(){ int dp1[50][3001]; int dp2[50][3001]; // x?????????, ?????¨???????¨???????y int mod=100000; int n,m,s; while(scanf("%d%d%d",&n,&m,&s)){ if(n==0&&m==0&&s==0) break; memset(dp1,0,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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
//TLEしなかったらAOJが神になった証 #include "bits/stdc++.h" using namespace std; #define int long long int mod=1e9+7; signed main(){ while(true){ int n,m,s; cin>>n>>m>>s; if(n==0&&m==0&&s==0)break; vector<vector<int> > dp(n*n+1,vector<int>(s+1,0)); dp[0][0]=1; for(int i=1;i<=m;i++){ for(int j=n*n-1...
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 posi...
{ "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 n, m, s; int dp[100][3010]; void solve(){ n *= n; memset(dp,0,sizeof(dp)); dp[0][0] = 1; for(int i = 1; i <= m; i++){ for(int j = n; j > 0; j--){ for(int k = i; k <= s; k++){ dp[j][k] = (dp[j][k]+dp[j-1][k-i])%100000; } } } printf("%d\n...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
//y09-6 ビンゴ(2回目) #include <iostream> #include <fstream> #include <stdio.h> #include <math.h> #include <time.h> #include <string> #include <vector> #include <map> #include <list> #include <set> #include <stack> #include <queue> #include <cstdlib> #include <algorithm> #include <random> #include <cassert> using namespace...
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 posi...
{ "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> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define reps(i,n) for(int i=1;i<=n;i++) int dp[50][2][3001]; int main(){ while(1){ int n,m,s; scanf("%d%d%d",&n,&m,&s); if(n==0)break; int t1=0,t2=1; n*=n; rep(i,50)rep(j,2)rep(k,s+1)dp[i][j][k]=0; dp[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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
//Bokann ga bokka--nn!! #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <string> #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 pair<i...
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 posi...
{ "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; using ll = long long; using ull = unsigned long long; typedef pair<ll, ll> P; typedef pair<ll, P> PP; typedef pair<P, P> PPP; const ll MOD = 1e9 + 7; const ll INF = 9e18; const double DINF = 5e14; const double eps = 1e-10; const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,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 posi...
{ "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; const ll mod = 1e5; ll partnum[50][3100]; void partition(ll a){ for(ll i = 0; i < 50; i++){ for(ll j = 0; j < 3100; j++){ partnum[i][j] = 0LL;} } partnum[0][0] = 1LL; for(ll i = 0; i <= a; i++){ partnum[1][i] = 1LL;} f...
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 posi...
{ "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 be(v) (v).begin(),(v).end() #define pb(q) push_back(q) typedef long long ll; using namespace std; const ll mod=1000000007, INF=mod*mod*3LL; #define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false); ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<cstdio> #include<iostream> using namespace std; int num[60][3010]; int main(){ int n,m,s; while(scanf("%d %d %d",&n,&m,&s) && (n||m||s)){ n = n*n; for(int i=0;i<=n;i++) for(int j=0;j<=s;j++)num[i][j] = 0; num[0][0] = 1; for(int i=1;i<=m;i++){ for(int j=n-1;j>=0;j--){ for(i...
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 posi...
{ "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 <algorithm> using namespace std; int dp[64][4096]; int N,M,S; 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=N*N;j>=0;j--){ for(int s=1;s<=S;s++){ if(s-i>=0) dp[j+1]...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
python3
for e in iter(input,'0 0 0'): N,M,S=map(int,e.split());N*=N d=[[0]*-~S for _ in[0]*-~N];d[0][0]=1 for i in range(1,N+1): for j in range(i,S+1): d[i][j]+=d[i][j-i]+d[i-1][j-i]-(M+1<=j and d[i-1][j-M-1]) print(d[N][S]%10**5)
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <vector> #include <iostream> using namespace std; const int mod = 100000; int N, M, S; int main() { while (cin >> N >> M >> S, N) { N *= N; M -= N; S -= N * (N + 1) / 2; vector<vector<int> > dp(M + 1, vector<int>(S + 1, 0)); dp[0][0] = 1; for (int i = 1; i <= N; i++) { vector<vector<int> > dp2(...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
python3
# coding:utf-8 import sys input = sys.stdin.readline MOD = 100000 def inpl(): return list(map(int, input().split())) while 1: N, M, S = inpl() if N == 0: break N *= N dp = [[0] * (S + 1) for _ in range(N + 1)] dp[0][0] = 1 for i in range(1, N + 1): for j in range(S + 1): ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
/*#include<stdio.h> #include<string.h> int dp[50][2001][3001]; int main(){ memset(dp,0,sizeof(dp)); for(int i=0;i<=2000;i++)dp[0][i][0]=1; for(int i=1;i<=2000;i++){ for(int j=1;j<=49;j++){ for(int k=0;k<=3000;k++){ dp[j][i][k]+=dp[j][i-1][k]; if(k-i>=0) dp...
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 posi...
{ "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(int (i)=0;(i)<(int)(n);++(i)) #define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr) #define all(x) (x).begin(),(x).end() #define mp make_pair #define pb push_back #define fi first #define se second int d...
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 posi...
{ "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(){ int n, m, s; while(cin >> n >> m >> s, n+m+s){ vector<vector<int>> dp(n*n+1, vector<int>(s+1,0)); dp[0][0] = 1; for(int i = 1; i <= m; i++){ // 今採用することを検討している数 vector<vector<int>> ...
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 posi...
{ "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; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define watch(a) { cout << #a << " = " << a << endl; } template<class T1, class T...
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 posi...
{ "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; using Int = long long; template<typename T> vector<T> make_v(size_t a){return vector<T>(a);} template<typename T> vector<vector<T> > make_v(size_t a,size_t b){ return vector<vector<T> >(a,make_v<T>(b)); } template<typename T> vector<vector<vector<T> > > make_v(size_t a,si...
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 posi...
{ "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; #define reps(i,j,n) for(int i = (j) ; i < (int)(n) ; ++i) #define rep(i,n) reps(i,0,n) #define each(it,c) for(__typeof (c).begin() it = (c).begin(); it != (c).end(); it++) #define all(v) (v).begin(), (v).end() #define pb(x) push_back(x) #define sz(x) (int)((x...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<stdio.h> #include<algorithm> using namespace std; int MOD=100000; int dp[2001][3001]; int sum[2001][3001]; int main(){ int a,b,c; while(scanf("%d%d%d",&a,&b,&c),a+b+c){ for(int i=0;i<2001;i++) for(int j=0;j<3001;j++) dp[i][j]=dp[i][j]=sum[i][j]=0; dp[0][0]=1; for(int i=0;i<=b;i++){ sum[i][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 posi...
{ "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" int main(){for(int n,m,s,i,j,d[50][3500],M=1e5;std::cin>>n>>m>>s,n*=n;){std::fill(d[0],d[50],M);d[0][0]=1;for(i=1;i<=n;++i)for(j=0;j<=s;++j){if(j>=i)d[i][j]+=d[i-1][j-i]+d[i][j-i];if(j>m)d[i][j]-=d[i-1][j-m-1];d[i][j]%=M;}printf("%d\n",d[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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
//y09-6 ビンゴ(3回目・自分で) #include <iostream> #include <fstream> #include <stdio.h> #include <math.h> #include <time.h> #include <string> #include <vector> #include <map> #include <list> #include <set> #include <stack> #include <queue> #include <cstdlib> #include <algorithm> #include <random> #include <cassert> using names...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
//Solution for aoj:0537 Bingo #include<iostream> #include<algorithm> #include<vector> #include<set> #define FOR(i,a,b) for(int i=(a);i<(b);i++) using namespace std; const int surplus = 100000; int N, ans; int b[2][2001][3001]; int main(){ int n, m, s; while (cin >> n >> m >> s){ if (!n&&!m&&!s) return 0; ans =...
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 posi...
{ "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 <iostream> #include <string> #include <cmath> #include <algorithm> #include <vector> #include <queue> #include <stack> using namespace std; void solve(int n,int m,int s){ int dp[50][3010]={0}; dp[0][0]=1; for(int i=1;i<=m;i++){ for(int j=n*n-...
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 posi...
{ "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.h> using namespace std; int dp[50][3001]; void solve() { int N, M, S; while(cin >> 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 = N * N; j > 0; --j) { for (int k = S; k >= i; --k) { dp[...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> #include <cstring> using namespace std; const int mod = 100000; int main(){ int n,m,s; int dp[50][3001]; while(cin>>n>>m>>s,n){ memset(dp,0,sizeof(dp)); dp[0][0]=1; for(int i=1;i<=m;++i){ for(int j=n*n-1;j>=0;--j){ for(int k=0;k<=s-i;+...
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 posi...
{ "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> #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) #define repeat_reverse(i,n) for (int i = (n)-1; (i) >= 0; --(i)) using namespace std; const int mod = 100000; int main() { while (true) { int n, m, s; cin >> n >> m >> s; if (n == 0 and m == 0 and s == 0) bre...
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 posi...
{ "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; #define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repl(i,0,n) #define mp(a,b) make_pair((a),(b)) #define pb(a) push_back((a)) #define all(x) (x).begin(),(x).end() #define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x)) #define fi first #define se...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> #include <queue> #include <algorithm> using namespace std; int dp[2][55][3005]; int n,m,s; int main(void){ while(1){ cin>>n>>m>>s; if(!n&&!m&&!s)break; n*=n; for(int i=0;i<=n;i++){ for(int j=0;j<=s;j++){ dp[0][i][j]=0; dp[1][i][j]=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 posi...
{ "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> int dp[50][3001]; int main() { int N,M,S; while(scanf("%d %d %d",&N,&M,&S),N) { memset(dp,0,sizeof(dp)); dp[0][0]=1; for(int m=1;m<=M;m++)for(int k=N*N;k>=1;k--)for(int s=m;s<=S;s++) { dp[k][s]+=dp[k-1][s-m]; if(dp[k][s]>100000)dp[k][s]-=100000; } printf("%d\n",dp[...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <vector> #include <list> #include <map> #include <set> #include <stack> #include <queue> #include <bitset> #include <algorithm> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <string> #include <cstring> #include <compl...
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 posi...
{ "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> using namespace std; #define rep(i,n) for(i=0;i<n;i++) #define reps(i,n) for(i=1;i<=n;i++) int dp[50][2][3001]; int main(){ int n,m,s,nn,st,i,j,k; int t1=0,t2=1; while(1){ scanf("%d%d%d",&n,&m,&s); if(n==0)break; t1=0; t2=1; n*=n; rep(i,50)rep(j,2)rep(k,s+1)d...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> using namespace std; int dp[55][3005]; int n,m,s,i,j,k; int main(void){ while(1){ cin>>n>>m>>s; if(!n)break; n*=n; for(i=0;i<=n;i++)for(j=0;j<=s;j++)dp[i][j]=0; dp[0][0]=1; for(i=1;i<=m;i++)for(j=n;j>0;j--)for(k=i;k<=s;k++)dp[j][k]=(dp[j-1][k-i]+dp[j][k])%100000; cout...
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 posi...
{ "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 PB push_back #define MP make_pair #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(a) (a).begin(),(a).end() using namespace std; typedef pair<int,int> P; typedef long long ll; const int INF=1e9; const int mod=100000; int dp[2][3010][50]; i...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <cstdio> #include <string.h> using namespace std; int n, m, s, ans; int dp[2][2001][3001]; int main(){ while(scanf("%d%d%d", &n, &m, &s) && n && m && s){ for(int i = 1; i <= m; i++) dp[0][i][i] = 1; for(int i = 2; i <= n * n; i++){ for(int j = 1; j < m; j++){ ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<iostream> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) int dp[50][3001]; const int MOD = 100000; int main() { while (true) { int n, m, s; cin >> n >> m >> s; if (n == 0) break; n = n * n; rep (i, 50) rep (j, 3001) dp[i][j] = 0; dp[0][0] = 1; rep (i, ...
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 posi...
{ "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,w=1e5; while(scanf("%d%d%d",&n,&m,&s),n){ int d[51][3001]={};d[0][0]=1; for(i=1;i<=n*n;i++)for(j=i;j<=s;j++){ int &x=d[i][j];x+=d[i-1][j-i]+d[i][j-i]; if(j-1-m>=0)x+=w-d[i-1][j-1-m];x%=w; }printf("%d\n",d[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 posi...
{ "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 <queue> #include <algorithm> #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define FORE(i,a,b) for(int i=(a);i<=(b);i++) #define REP(i,b) FOR(i,0,b) using namespace std; typedef long long ll; int DP[2][2001][3001]; int main() { int N,M,S; while(cin >> N >...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <vector> #include <iostream> using namespace std; const int mod = 100000; int N, M, S; int main() { while (cin >> N >> M >> S, N) { N *= N; M -= N; S -= N * (N + 1) / 2; vector<vector<int> > dp(M + 1, vector<int>(S + 1, 0)); dp[0][0] = 1; for (int i = 0; i < N; i++) { vector<vector<int> > dp2(M...
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 posi...
{ "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 <ctime> #include <cassert> #include <iostream> #include <cctype> #include <sstream> #include <string> #include <list> #include <vector> #include <queue> #include <set> #include <stack> #include <map> #include <utility> #include <numeric> ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<map> #include<set> #include<list> #include<cmath> #include<queue> #include<stack> #include<cstdio> #include<string> #include<vector> #include<complex> #include<cstdlib> #include<cstring> #include<numeric> #include<sstream> #include<iostream> #include<algorithm> #include<functional> #define mp make_pair ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<map> #include<set> #include<list> #include<cmath> #include<queue> #include<stack> #include<cstdio> #include<string> #include<vector> #include<complex> #include<cstdlib> #include<cstring> #include<numeric> #include<sstream> #include<iostream> #include<algorithm> #include<functional> #define mp make_pair ...
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 posi...
{ "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 <stack> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <cassert> using namespace std; #define FOR(i,k,n) for(int i=(k); i<(int)(n);...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<iostream> using namespace std; int d[51][3210],n,m,s,i,j,k; int main(){ while(cin>>n>>m>>s&&n){ n*=n; for(i=0;i<=n;i++)for(j=0;j<=s;j++)d[i][j]=0;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; } r...
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 posi...
{ "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> int dp[50][3001]; int main() { int n,m,s; while(scanf("%d %d %d",&n,&m,&s),n) { memset(dp,0,sizeof(dp)); dp[0][0]=1; for(int i=1;i<=m;i++) for(int j=n*n;j>=1;j--) for(int k=i;k<=s;k++) { dp[j][k]+=dp[j-1][k-i]; if(dp[j][k]>=100000)dp[j][k]-=100000; } p...
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 posi...
{ "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 <cstring> using namespace std; int dp[2][3001][50]; const int mod=100000; int n,m,s; int main(){ while(cin>>n>>m>>s&&(n|m|s)){ memset(dp,0,sizeof(dp)); for(int i=0;i<2;i++)dp[i][0][n*n]=1; for(int i=m;i>=0;i--){ for(int j=0;j<=...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <iostream> #include <cstdio> #include <sstream> #include <cmath> #include <cstdlib> #include <algorithm> #include <queue> #include <stack> #include <limits> #include <map> #include <string> #include <cstring> #include <set> #include <deque> #include <bitset> #i...
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 posi...
{ "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 FOR(i,a,b) for(int i=(a);i<(b);i++) #define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--) #define REP(i,n) for(int i=0;i<(n);i++) #define RREP(i,n) for(int i=n-1;i>=0;i--) #define PB push_back #define INF (1<<29) #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(),(a).rend() ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
//AOJ0537 bingo #include <iostream> #include <algorithm> #include <vector> #define MOD 100000 using namespace std; int main(){ int n,m,s; /*int dp[2001][50][3001] = {}; dp[1][1][1] = 1; dp[1][0][0] = 1; for(int i = 2;i <= 2000;i++){ for(int j = 0;j <= 49;j++){ for(int k = 0;k <= 3000;k++){ if(j == 0) dp[...
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 posi...
{ "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 range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) for(int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; const int M = 100000; int main(){ int n, m, s; while(cin >> n >> m >> s,n){ ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <stdio.h> #include <string.h> #include <algorithm> #include <iostream> #include <math.h> #include <assert.h> #include <vector> using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; static const double EPS = 1e-9; static const double PI = acos(-1.0); #define REP...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<iostream> #include<cstring> using namespace std; int n,m,s; int map[50][3001]; int main(void){ while(1){ cin >> n >> m >> s; if(n==0 && m==0 && s==0)break; memset(map,0,sizeof(map)); map[0][0]=1; for(int i=1;i<=m;i++){ for(int j=n*n;j>=1;j--){ for(int k=i;k<=s;k++){ map[j][k]=(map[j][...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
java
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); for(;;) { int n = sc.nextInt(), m...
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 posi...
{ "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<algorithm> #include<vector> #include<map> #include<cstdio> #include<cstring> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define REP(n) rep(i,n) #define all(n) n.begin(),n.end() const int MAXN = 7, MAXS = 3000 ; int n, m, s; unsigned int dp[MAXN * MAXN + 2][...
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 posi...
{ "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 <cstring> constexpr int MOD=(int)1e5; constexpr int MAX_S=3000; int n,m,s; int dp[50][MAX_S+1]; int main() { while(std::cin>>n>>m>>s, n+m+s){ std::memset(dp,0,sizeof(dp)); dp[0][0]=1; for(int i=1;i<=std::min(m,s);++i){ fo...
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 posi...
{ "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> #define mod 100000 using namespace std; int dp[50][3001]; int main() { int n,m,s; while(scanf("%d%d%d",&n,&m,&s),n){ n*=n; memset(dp,0,sizeof(dp)); dp[0][0]=1; for(int i=1;i<=m;i++){ for(int j=n;j>0;j--){ for(int l=i;l<=s;l++){ dp[j][l]=(dp[j][l]+dp[j-1][l-i])%m...
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 posi...
{ "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 (...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
//#define __USE_MINGW_ANSI_STDIO 0 #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #defi...
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 posi...
{ "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; /* 1からmまでの数をn*n個重複しないように選び、合計がsになるパターンの数を求める。 ナップサック */ int n,m,s; int dp[50][3001]; int main(){ while(cin>>n>>m>>s,n){ //初期化? for(int i=0;i<50;i++)for(int j=0;j<=3000;j++)dp[i][j]=0; dp[0][0]=1; for(int i=1;i<=m;i++){ for(int j=n*n...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> using namespace std; void solve(int N, int M, int S) { int dp[2][M+1][S+1]; dp[0][0][0]=0; dp[1][0][0]=0; for(int j=1; j<=M; ++j) { dp[0][j][0]=0; dp[1][j][0]=0; for(int k=1; k<=S; ++k) { dp[1][j][k]=(k<=j?1:0); dp[0][j][k]=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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
//びぃあいえぬじぃおぉ=BINGO!! #include <cstdio> int main(void) { while (1){ int n, m, s; scanf("%d%d%d", &n, &m, &s); int dp[50][3001]={0}; if (n == 0) break; dp[0][0] = 1; for (int i = 1; i <= m; i++){ for (int j = n * n; j >= 1; j--){ f...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0537 // status: // tag: [DP] #define SUBMIT //#define DEBUG #include <bits/stdc++.h> using namespace std; using ui64 = unsigned long long; using i64 = long long; const int MOD = 100000; // dp[i][j] 場所iで今の合計がjになる組み合わせの数 int dp[7 * 7 + 1][3000 + 1]; int N, M...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include<iostream> #include<cstring> using namespace std; const int MOD = 100000; int n, m, s; int dp[2][2001][3001]; int main() { while(cin >> n >> m >> s && n && m && s){ memset(dp, 0, sizeof dp); int ans = 0; dp[0][0][0] = 1; for(int i = 1; i <= n * n; i++){ for(int j = 1; j <= m; j++) ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <stdio.h> #include <string.h> #include <array> using namespace std; int n, m, s; array<array<array<int, 3001>, 2001>,2>memo; int main() { for (;;) { scanf("%d %d %d",&n,&m,&s); if (n == 0)break; for (int i = 0; i <= n*n; ++i) { for (int j = 0; j <= m; ++j) { for (int k = 0; k <= 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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <stdio.h> #include <algorithm> using namespace std; int _now[50*3001]; int _next[50*3001]; int main(){ while(1){ int n,m,s; scanf("%d%d%d",&n,&m,&s); if(n==0&&m==0&&s==0) break; int* now = _now; fill(now,now+(n*n+1)*(s+1),0); int* next = _next; fill(next,next+(n*n+1)*(s+1),0); now[0] = 1...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
CORRECT
cpp
#include <iostream> #include <cstring> using namespace std; int n,m,s; int dp[50][3001]; int main() { while(cin>>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=n*n; j>0; --j) for (int k=s; k>=i; --k) dp[j][k] = (...
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 posi...
{ "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 dp[10][55][3010] = {0}; int main() { int N,M,S; while(scanf("%d%d%d",&N,&M,&S),N + M + S) { for(int i = 1; i < N * N + 1; i++) { for(int j = 1; j < S + 1; j++) { dp[0][i][j] = 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 posi...
{ "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 main(){ int n,m,s; while(scanf("%d %d %d",&n,&m,&s),n!=0&&m!=0&&s!=0){ int sum[50][3001] = {}; sum[0][0] = 1; for(int i=1;i<=m;i++){ for(int j=min(i,n*n);j>0;j--){ for(int k=i;k<=s;k++){ sum[j][k] = (sum[j][k] + sum[j-1][k-i])%100000; } }...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> long long dp[3001][50]; int main() { int n, m, s; while (scanf("%d%d%d", &n, &m, &s)) { if (!n && !m && !s) break; memset(dp, 0, sizeof(dp)); dp[0][0] = 1; for (int i = 1; i <= m; i++) { for (int j = n * n; j > 0; j--) { for (int k = 1; k <= s; k++) { ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int DP[50][2001][3001]; int main() { int N, M, S; cin >> N >> M >> S; for (int i = 1; i <= M; i++) { DP[1][i][i] = 1; } for (int i = 2; i <= N * N; i++) { for (int j = i - 1; j <= M; j++) { for (int k = 1; k <= S; k++) { for (int s = j + 1; 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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> long long dp[3001][50]; int main() { int n, m, s; while (scanf("%d%d%d", &n, &m, &s)) { if (!n && !m && !s) 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 = n * n; j > 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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int dp[2][3001][50]; const int mod = 100000; int n, m, s; int main() { while (cin >> n >> m >> s && (n | m | s)) { for (int i = 0; i < 2; i++) dp[i][0][n * n] = 1; for (int i = m; i >= 0; i--) { for (int j = 0; j <= s; j++) { for (int k = n * n; k >=...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main(void) { int i, j, k; int n, m, s; for (i = 0; scanf("%d%d%d", &n, &m, &s), n; ++i) { if (i == 1) { if (n % 4 == 0) { for (;;) ; } if (n % 4 == 1) { exit(1); } if (n % 4 == 2) { puts("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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include<stdio.h> #include<stdlib.h> #include<string.h> #define REP(i,n) for(i=0; i<(int)(n); i++) #define rep(i,s,n) for(i=(s); i<(int)(n); i++) typedef unsigned int uint; int getInt(){ int ret = 0,c; c = getchar(); while(!isdigit(c)) c = getchar(); while(isdigit(c)){ ret *= 10; ret += c - '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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int n, m, s; array<array<array<int, 3001>, 2001>, 2> memo; int main() { for (;;) { scanf("%d %d %d", &n, &m, &s); if (n == 0) break; for (int i = 0; i <= n * n; ++i) { for (int j = 0; j <= m; ++j) { for (int k = 0; k <= s; ++k) { int an...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; const long long hmod1 = 999999937; const long long hmod2 = 1000000000 + 9; const long long INF = 1 << 30; const long long mod = 1000000000 + 7; const int dx4[4] = {1, 0, -1, 0}; const int dy4[4] = {0, 1, 0, -1}; const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1}; const int dy8[...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
@memory = {} def count(size, max, sum) return @memory[[size, max, sum]] if @memory[[size, max, sum]] return @memory[[size, max, sum]] = 1 if size == 1 # 譛?、ァ隕∫エ??譛?、ァ蛟、 max_max = [sum - size * (size - 1) / 2, max].min # 譛?、ァ隕∫エ??譛?ー丞? n = (size ** 2) - size + 2 * sum d = 2 * size max_min = n / d ma...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> long long dp[3001][50]; int main() { int n, m, s; while (scanf("%d%d%d", &n, &m, &s)) { if (!n && !m && !s) 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 = n * n; j > 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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; const int surplus = 100000; int N, ans; int b[50][2001][3001]; int main() { int n, m, s; while (cin >> n >> m >> s) { if (!n && !m && !s) return 0; ans = 0; N = n * n; for (int i = (1); i < (m + 1); i++) b[1][i][i] = 1; for (int i = (1); i < (N + 1);...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
java
import java.util.*; public class Main{ static final int m_max=2001, s_max=3001; public static void main(String[] args){ Scanner scn = new Scanner(System.in); int[][][] table = new int[2][m_max][s_max]; int n,m,s; n = scn.nextInt(); n = n*n; m = scn.nextInt(); s = scn.nextInt(); for(int i=1; i<=m; i++...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int mod = 100000; int N, M, S; int dp[2009][3009]; int dpsum[2009][3009]; int main() { while (true) { scanf("%d%d%d", &N, &M, &S); if (N == 0 && M == 0 && S == 0) break; dp[0][0] = 1; for (int i = 1; i <= N * N; i++) { for (int j = 0; j <= M; j++) { ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include<bits/stdc++.h> using namespace std; int dp[2200][3200],_prev[2200][3200],n,m,s; int main(){ while(true){ cin>>n>>s>>m;if(n==0)return 0;n*=n; for(int i=0;i<2200;i++){fill(dp[i],dp[i]+3180);fill(_prev[i],_prev[i]+3180);} for(int i=0;i<=s;i++)_prev[i][0]=1; for(int i=0;i<n;i++){ for(int j=1;j<=s;j++){...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
import std.algorithm; import core.stdc.stdio; void main(){ int n,m,s; scanf("%d%d%d",&n,&m,&s); int[] now = new int[(m+1)*(s+1)]; int[] next = new int[(m+1)*(s+1)]; now[0] = 1; for(int _=0;_<n*n;_++){ next[] = 0; for(int i=0;i<m;i++){ for(int j=0;j<s;j++){ for(int k=1;k*(n*n-_)<=(s-j) && k<=m-i;k++){ ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> long long dp[2][2001][3001]; int min(int a, int b) { return a < b ? a : b; } int main() { int n, m, s; int i, j, k, l; scanf("%d %d %d", &n, &m, &s); for (i = 0; i <= m; i++) for (j = 0; j <= s; j++) dp[1][i][j] = 0; dp[1][0][0] = 1; for (i = 0; i < n * n; i++) { for (j = 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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; const int mod = 100000; int N, M, S; int main() { while (cin >> N >> M >> S, N) { N *= N; M -= N; S -= N * (N + 1) / 2; vector<vector<vector<int> > > dp( N + 1, vector<vector<int> >(M + 1, vector<int>(S + 1, 0))); dp[0][0][0] = 1; for (int ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int dp[2][2001][3001]; const int mod = 100000; int main() { int n, m, s; while (cin >> n >> m >> s) { if (n == 0) break; n *= n; dp[0][0][0] = 1; for (int i = 0; i < n; i++) { int now = i & 1; int next = now ^ 1; for (int j = 0; j <= m;...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> int n, m, s; int memo[50][2001][3001]; int f(int i, int j, int k) { if (memo[i][j][k] >= 0) return memo[i][j][k]; int ans = 0; if (i == 0) { if (j == 0 && k == 0) ans = 1; else ans = 0; } else { if (j <= 0 || k < j) { ans = 0; } else { ans = f(i -...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; const int _dx[] = {0, 1, 0, -1}; const int _dy[] = {-1, 0, 1, 0}; int getInt() { int ret = 0, c; c = getchar(); while (!isdigit(c)) c = getchar(); while (isdigit(c)) { ret *= 10; ret += c - '0'; c = getchar(); } return ret; } int n, m, second; int me...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <bits/stdc++.h> int main(void) { int i, j, k; int n, m, s; int hoge = 0; while (scanf("%d%d%d", &n, &m, &s), n) { ++hoge; if (hoge >= 3) exit(1); } puts("a"); 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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int x[2000 + 1][3000 + 1]; int y[2000 + 1][3000 + 1]; int main() { int n, m, s, d, e, f; while (true) { cin >> n >> m >> s; if ((n == 0 && m == 0) && s == 0) { break; } memset(x, 0, sizeof(x)); memset(y, 0, sizeof(y)); for (int i = 1; i <= ...
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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
UNKNOWN
#include <bits/stdc++.h> int main(void) { int i, j, k; int n, m, s; int hoge = 0; while (scanf("%d%d%d", &n, &m, &s), n) { ++hoge; if (hoge >= 25) exit(1); } puts("a"); 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 posi...
{ "input": [ "3 9 45\n3 100 50\n5 50 685\n0 0 0" ], "output": [ "1\n7\n74501" ] }
{ "input": [], "output": [] }
IN-CORRECT
cpp
#include <bits/stdc++.h> #pragma warning(disable : 4996) using namespace std; using ld = long double; template <class T> using Table = vector<vector<T>>; const ld eps = 1e-9; const int mod = 100000; struct Mod { public: int num; Mod() : Mod(0) { ; } Mod(long long int n) : num((n % mod + mod) % mod) { static_...