Submission #9848

#TimeUsernameProblemLanguageResultExecution timeMemory
9848effservUniting (kriii2_U)C++98
1 / 4
6 ms416 KiB
#include <cstdio> #include <algorithm> using namespace std; typedef long long ll; int main() { int N; scanf("%d", &N); ll a; scanf("%lld", &a); ll A = (ll)a; ll C = 0; for (int i = 0; i < N - 1; i++) { scanf("%lld", &a); C += A*a; A += a; } printf("%lld\n", C); ll mod = 1000000007; ll bigmod = 1e13; ll S = N; for (int i = N - 1; i >= 1; i--) { S *= (ll)i; S %= bigmod; S *= (ll)i; S %= bigmod; } printf("%lld\n", S%mod); return 0; }

Compilation message (stderr)

U.cpp: In function 'int main()':
U.cpp:12:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |  scanf("%d", &N);
      |  ~~~~~^~~~~~~~~~
U.cpp:15:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |  scanf("%lld", &a);
      |  ~~~~~^~~~~~~~~~~~
U.cpp:21:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |   scanf("%lld", &a);
      |   ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...