답안 #371151

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
371151 2021-02-26T01:36:50 Z daniel920712 Intergalactic ship (IZhO19_xorsum) C++14
0 / 100
2000 ms 5740 KB
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;
long long all[200005];
pair < pair < long long , long long > , long long > tt[200005];
long long ans=0,N,M,MOD=1e9+7;
void F(long long here)
{
    long long i,j;
    if(here==M)
    {
        for(i=1;i<=N;i++)
        {
            ans+=(all[i]*all[i]*(i)*(N-i+1))%MOD;
            ans%=MOD;
            for(j=i+1;j<=N;j++)
            {
                ans+=all[i]*all[j]*(i)*(N-j+1)*2%MOD;
                ans%=MOD;
            }
            ans%=MOD;
        }
        return;
    }
    F(here+1);
    for(i=tt[here].first.first;i<=tt[here].first.second;i++) all[i]^=tt[here].second;
    F(here+1);
    for(i=tt[here].first.first;i<=tt[here].first.second;i++) all[i]^=tt[here].second;
}
int main()
{
    long long i;
    scanf("%lld",&N);
    for(i=1;i<=N;i++) scanf("%lld",&all[i]);
    scanf("%lld",&M);
    for(i=0;i<M;i++) scanf("%lld",&tt[i].first.first,&tt[i].first.second,&tt[i].second);
    F(0);
    printf("%lld\n",ans);
    return 0;
}

Compilation message

xorsum.cpp: In function 'int main()':
xorsum.cpp:38:28: warning: too many arguments for format [-Wformat-extra-args]
   38 |     for(i=0;i<M;i++) scanf("%lld",&tt[i].first.first,&tt[i].first.second,&tt[i].second);
      |                            ^~~~~~
xorsum.cpp:35:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   35 |     scanf("%lld",&N);
      |     ~~~~~^~~~~~~~~~~
xorsum.cpp:36:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   36 |     for(i=1;i<=N;i++) scanf("%lld",&all[i]);
      |                       ~~~~~^~~~~~~~~~~~~~~~
xorsum.cpp:37:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   37 |     scanf("%lld",&M);
      |     ~~~~~^~~~~~~~~~~
xorsum.cpp:38:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   38 |     for(i=0;i<M;i++) scanf("%lld",&tt[i].first.first,&tt[i].first.second,&tt[i].second);
      |                      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Incorrect 1 ms 364 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Incorrect 1 ms 364 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2082 ms 5740 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2076 ms 364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2072 ms 364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2072 ms 364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Incorrect 1 ms 364 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Incorrect 1 ms 364 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Incorrect 1 ms 364 KB Output isn't correct
4 Halted 0 ms 0 KB -