Submission #444997

# Submission time Handle Problem Language Result Execution time Memory
444997 2021-07-16T08:03:31 Z fuad27 Fancy Fence (CEOI20_fancyfence) C++14
0 / 100
1 ms 204 KB
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007

#define int long long
int multiply(int a, int b)
{
   return ((a % mod) * (b % mod))%mod;
}
int32_t main () { 
	int n, m;
	cin >> n;
	int sumW = 0;
	for(int i = 0;i<n;i++) {
		int h;
		cin >> h;
		m = h;
		m%=mod;
	}
	for(int i = 0;i<n;i++) {
		int w;
		cin >> w;
		sumW += w%mod;
		sumW%=mod;
	}
	cout<<multiply(multiply(sumW, sumW+1)/2, multiply(m, m+1)/2)%mod;
}

Compilation message

fancyfence.cpp: In function 'int32_t main()':
fancyfence.cpp:26:51: warning: 'm' may be used uninitialized in this function [-Wmaybe-uninitialized]
   26 |  cout<<multiply(multiply(sumW, sumW+1)/2, multiply(m, m+1)/2)%mod;
      |                                           ~~~~~~~~^~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -