QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#777819#6777. 向量内积fmsCompile Error//C++141.5kb2024-11-24 10:02:502024-11-24 10:02:50

Judging History

你现在查看的是最新测评结果

  • [2024-11-24 10:02:50]
  • 评测
  • [2024-11-24 10:02:50]
  • 提交

answer

#include<bits/stdc++.h>
#include<experimental/simd>
namespace stdx=std::experimental;
using I=int;
using u8=uint8_t;using u16=uint16_t;using u32=uint32_t;using u64=uint64_t;
template<class T>using V=std::vector<T>;
void solve(){
  I n,d,k;std::cin>>n>>d>>k;
  if(d!=100){
    V<V<u8>>x(n,V<u8>(d));
    for(auto&e:x)for(auto&f:e){
      I x;std::cin>>x;f=x%k;
    }
    for(I i=0;i<n;i++){
      for(I j=i+1;j<n;j++){
        u8 s=0;
        for(I k=0;k<d;k++)s+=x[i][k]*x[j][k];
        if(s%k==0){std::cout<<i+1<<' '<<j+1<<'\n';return;}
      }
    }
  }else if(d==100){
    alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      std::array<u8,2000000>x;
    for(I i=0;i<n;i++)for(I j=0;j<d;j++){
      I t;std::cin>>t;x[i*n+j]=t%k;
    }
    for(I i=0;i<n;i++){
      for(I j=i+1;j<n;j++){
        stdx::native_simd<u8>s=0;
        I k=0;
        for(;k<100;k+=stdx::native_simd<u8>::size()){
          stdx::native_simd<u8>xi(&x[i*n+k],stdx::vector_aligned);
          stdx::native_simd<u8>xj(&x[j*n+k],stdx::vector_aligned);
          s+=xi*xj;
        }
        alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
          std::array<u8,stdx::native_simd<u8>::size()>sa;
        s.copy_to(&sa[0],stdx::vector_aligned);
        for(;k<100;k++){
          sa[0]+=x[i*n+k]*x[j*n+k];
        }
        u8 ss=0;for(u8 e:sa)ss+=e;
        if(ss%k==0){std::cout<<i+1<<' '<<j+1<<'\n';return;}
      }
    }
  }
  std::cout<<"-1 -1\n";
}
int main(){
  std::cin.tie(0)->sync_with_stdio(0);
  solve();
  return 0;
}

Details

answer.code:3:21: error: ‘experimental’ is not a namespace-name
    3 | namespace stdx=std::experimental;
      |                     ^~~~~~~~~~~~
answer.code: In function ‘void solve()’:
answer.code:22:13: error: ‘stdx’ has not been declared
   22 |     alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      |             ^~~~
answer.code:22:38: error: ‘stdx’ has not been declared
   22 |     alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      |                                      ^~~~
answer.code:22:58: error: expected primary-expression before ‘>>’ token
   22 |     alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      |                                                          ^~
answer.code:22:60: error: expected primary-expression before ‘)’ token
   22 |     alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      |                                                            ^
answer.code:22:5: warning: attributes at the beginning of statement are ignored [-Wattributes]
   22 |     alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   23 |       std::array<u8,2000000>x;
      |       ~~~~~~~~~~~~~~~~~~~~~~~
answer.code:25:23: error: ‘x’ was not declared in this scope
   25 |       I t;std::cin>>t;x[i*n+j]=t%k;
      |                       ^
answer.code:29:9: error: ‘stdx’ has not been declared
   29 |         stdx::native_simd<u8>s=0;
      |         ^~~~
answer.code:29:29: error: expected primary-expression before ‘>’ token
   29 |         stdx::native_simd<u8>s=0;
      |                             ^
answer.code:29:30: error: ‘s’ was not declared in this scope
   29 |         stdx::native_simd<u8>s=0;
      |                              ^
answer.code:31:23: error: ‘stdx’ has not been declared
   31 |         for(;k<100;k+=stdx::native_simd<u8>::size()){
      |                       ^~~~
answer.code:31:43: error: expected primary-expression before ‘>’ token
   31 |         for(;k<100;k+=stdx::native_simd<u8>::size()){
      |                                           ^
answer.code:31:46: error: ‘::size’ has not been declared
   31 |         for(;k<100;k+=stdx::native_simd<u8>::size()){
      |                                              ^~~~
answer.code:32:11: error: ‘stdx’ has not been declared
   32 |           stdx::native_simd<u8>xi(&x[i*n+k],stdx::vector_aligned);
      |           ^~~~
answer.code:32:31: error: expected primary-expression before ‘>’ token
   32 |           stdx::native_simd<u8>xi(&x[i*n+k],stdx::vector_aligned);
      |                               ^
answer.code:32:36: error: ‘x’ was not declared in this scope
   32 |           stdx::native_simd<u8>xi(&x[i*n+k],stdx::vector_aligned);
      |                                    ^
answer.code:32:45: error: ‘stdx’ has not been declared
   32 |           stdx::native_simd<u8>xi(&x[i*n+k],stdx::vector_aligned);
      |                                             ^~~~
answer.code:32:32: error: ‘xi’ was not declared in this scope; did you mean ‘i’?
   32 |           stdx::native_simd<u8>xi(&x[i*n+k],stdx::vector_aligned);
      |                                ^~
      |                                i
answer.code:33:11: error: ‘stdx’ has not been declared
   33 |           stdx::native_simd<u8>xj(&x[j*n+k],stdx::vector_aligned);
      |           ^~~~
answer.code:33:31: error: expected primary-expression before ‘>’ token
   33 |           stdx::native_simd<u8>xj(&x[j*n+k],stdx::vector_aligned);
      |                               ^
answer.code:33:45: error: ‘stdx’ has not been declared
   33 |           stdx::native_simd<u8>xj(&x[j*n+k],stdx::vector_aligned);
      |                                             ^~~~
answer.code:33:32: error: ‘xj’ was not declared in this scope; did you mean ‘j’?
   33 |           stdx::native_simd<u8>xj(&x[j*n+k],stdx::vector_aligned);
      |                                ^~
      |                                j
answer.code:36:17: error: ‘stdx’ has not been declared
   36 |         alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      |                 ^~~~
answer.code:36:42: error: ‘stdx’ has not been declared
   36 |         alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      |                                          ^~~~
answer.code:36:62: error: expected primary-expression before ‘>>’ token
   36 |         alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      |                                                              ^~
answer.code:36:64: error: expected primary-expression before ‘)’ token
   36 |         alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      |                                                                ^
answer.code:36:9: warning: attributes at the beginning of statement are ignored [-Wattributes]
   36 |         alignas(stdx::memory_alignment_v<stdx::native_simd<u8>>)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...