Submission #3777161
Source Code Expand
#include <cstdio> #include <vector> using namespace std; using ull = unsigned long long; constexpr int mod = 1000000007; constexpr int MAX = 4010; 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 | RE |
Exec Time | 2104 ms |
Memory | 125696 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 | RE | 155 ms | 124160 KB |
01-02.txt | RE | 157 ms | 124160 KB |
01-03.txt | RE | 172 ms | 124928 KB |
01-04.txt | RE | 190 ms | 125696 KB |
01-05.txt | RE | 190 ms | 125696 KB |
01-06.txt | RE | 189 ms | 125696 KB |
01-07.txt | AC | 59 ms | 124160 KB |
01-08.txt | TLE | 2104 ms | 125696 KB |
01-09.txt | RE | 188 ms | 125696 KB |
01-10.txt | RE | 189 ms | 125568 KB |
01-11.txt | RE | 189 ms | 125696 KB |
01-12.txt | RE | 189 ms | 125696 KB |
01-13.txt | RE | 192 ms | 125696 KB |
01-14.txt | RE | 192 ms | 125696 KB |
sample-01.txt | AC | 58 ms | 124160 KB |