Submission #1516879
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5+5, M = 1e9+7; ll p[N]; ll tot(int n) { for(int i = 0; i < n; ++i) scanf("%lld",p+i); ll ans = 0; for(int i = 1; i < n; ++i) ans = (ans + i * (n-i) % M * (p[i]-p[i-1])) % M; return ans; } int main() { int n,m; scanf("%d%d",&n,&m); printf("%lld\n",tot(n) * tot(m) % M); }
Submission Info
Submission Time | |
---|---|
Task | D - ### |
User | cephian |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 389 Byte |
Status | WA |
Exec Time | 24 ms |
Memory | 1024 KB |
Compile Error
./Main.cpp: In function ‘ll tot(int)’: ./Main.cpp:10:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lld",p+i); ^ ./Main.cpp: In function ‘int main()’: ./Main.cpp:19:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d",&n,&m); ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt |
All | 0_000.txt, 0_001.txt, max.txt, min.txt, mod.txt, n2.txt, rndA.txt, rndB.txt, rndC.txt, rndD.txt, rndE.txt, rndF.txt, rndG.txt, rndH.txt, rndI.txt, rndJ.txt, var.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 1 ms | 256 KB |
0_001.txt | AC | 1 ms | 256 KB |
max.txt | WA | 24 ms | 1024 KB |
min.txt | AC | 1 ms | 256 KB |
mod.txt | AC | 13 ms | 1024 KB |
n2.txt | AC | 13 ms | 1024 KB |
rndA.txt | WA | 24 ms | 1024 KB |
rndB.txt | WA | 24 ms | 1024 KB |
rndC.txt | WA | 24 ms | 1024 KB |
rndD.txt | WA | 24 ms | 1024 KB |
rndE.txt | WA | 24 ms | 1024 KB |
rndF.txt | WA | 24 ms | 1024 KB |
rndG.txt | WA | 24 ms | 1024 KB |
rndH.txt | WA | 24 ms | 1024 KB |
rndI.txt | WA | 24 ms | 1024 KB |
rndJ.txt | WA | 24 ms | 1024 KB |
var.txt | WA | 24 ms | 1024 KB |