CSES - Datatähti 2019 alku - Results
Submission details
Task:Taulukko
Sender:borkbork
Submission time:2018-10-09 16:25:18 +0300
Language:C++
Status:COMPILE ERROR

Compiler report

output/ccgZV2PM.o: In function `_GLOBAL__sub_I_a':
code.cpp:(.text.startup+0xd3): relocation truncated to fit: R_X86_64_PC32 against `.bss'
code.cpp:(.text.startup+0xf1): relocation truncated to fit: R_X86_64_PC32 against `.bss'
collect2: error: ld returned 1 exit status

Code

#include<iostream>
#include<unordered_set>
#include<unordered_map>
#include<vector>

unsigned int a[1000001000];

int main(){
    std::ios_base::sync_with_stdio(0);std::cin.tie(NULL);
    unsigned int n,k;
    std::cin>>n>>k;
    unsigned int d[500100];

    for(size_t i=0;i<n;i++){std::cin>>d[i];}
    
    unsigned long long res=n*k;
    if(1<k) res-=(k*(k-1))/2;
    /*
    if(n==k){std::cout<<res;return 0;}
    unsigned long long count=0;
    for(size_t i=0;i<k+1;i++){
        if(!a[d[i]]){count++;}
    }

    for(size_t i=0;i<n-k;i++){
        if(!a[d[i]]){}
    }
    */
    
    std::cout<<res;
    
}