Submission #3777172
Source Code Expand
#include <cstdio> #include <vector> using namespace std; using ull = unsigned long long; constexpr int mod = 1000000007; constexpr int MAX = 8010; ull comb[MAX][MAX]; void combInit(){ for(int i = 0; i < MAX; i++) comb[i][0] = comb[i][i] = 1; for(int i = 2; i < MAX; i++){ for(int j = 1; j < i; j++){ comb[i][j] = comb[i-1][j-1]%mod + comb[i-1][j]%mod; comb[i][j] %= mod; } } } int main(){ int n, a, b; ull ans = 0; scanf("%d", &n); vector<int> meat(n), sum(n); for(int i = 0; i < n; i++){ scanf("%d %d", &a, &b); meat[i] = a, sum[i] = a+b; } combInit(); for(int i = 0; i < n-1; i++){ for(int j = i+1; j < n; j++){ ans += comb[sum[i]+sum[j]][meat[i]+meat[j]]%mod; } } printf("%lld\n", ans); return 0; }
Submission Info
Submission Time | |
---|---|
Task | E - BBQ Hard |
User | tavercy022 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 834 Byte |
Status | TLE |
Exec Time | 2105 ms |
Memory | 501120 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:24:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ ./Main.cpp:27:27: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &a, &b); ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 1400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt |
All | sample-01.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, sample-01.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | MLE | 211 ms | 499584 KB |
01-02.txt | MLE | 221 ms | 499584 KB |
01-03.txt | TLE | 2105 ms | 500352 KB |
01-04.txt | TLE | 2105 ms | 501120 KB |
01-05.txt | TLE | 2105 ms | 501120 KB |
01-06.txt | TLE | 2105 ms | 501120 KB |
01-07.txt | MLE | 213 ms | 499584 KB |
01-08.txt | TLE | 2105 ms | 501120 KB |
01-09.txt | TLE | 2105 ms | 501120 KB |
01-10.txt | TLE | 2105 ms | 501120 KB |
01-11.txt | TLE | 2105 ms | 501120 KB |
01-12.txt | TLE | 2105 ms | 501120 KB |
01-13.txt | TLE | 2105 ms | 501120 KB |
01-14.txt | TLE | 2105 ms | 501120 KB |
sample-01.txt | MLE | 212 ms | 499584 KB |