Submission #3410315
Source Code Expand
#include <bits/stdc++.h> using namespace std; inline long long read(){ char ch=getchar(); long long r=0,s=1; while(!isdigit(ch)){ if(ch=='-')s=-1; ch=getchar(); } while(isdigit(ch)){ r=r*10+ch-'0'; ch=getchar(); } return r*s; } long long n,m,a,s,c[1000000005],b,i,k; int main() { n=read(); a=read(); b=read(); for(i=1;i<=n;i++) c[i]=read(); for(i=2;i<=n;i++) { if((c[i]-c[i-1])*a>=b) s=s+b; else s=s+(c[i]-c[i-1])*a; } cout<<s<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Walk and Teleport |
User | vjudge4 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 485 Byte |
Status | CE |
Compile Error
/tmp/ccDSEg4K.o: In function `main': Main.cpp:(.text.startup+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccDSEg4K.o Main.cpp:(.text.startup+0x1e): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccDSEg4K.o Main.cpp:(.text.startup+0x2a): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccDSEg4K.o Main.cpp:(.text.startup+0xe7): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccDSEg4K.o Main.cpp:(.text.startup+0x117): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccDSEg4K.o Main.cpp:(.text.startup+0x125): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccDSEg4K.o Main.cpp:(.text.startup+0x165): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccDSEg4K.o Main.cpp:(.text.startup+0x19d): ...