Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#2 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#3 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#4 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#5 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#6 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#7 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#8 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#9 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#10 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#11 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#12 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#13 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
||
#14 |
Error de compilación
main.cpp:1:1: error: no template named 'include' include<iostream> ^ main.cpp:1:9: error: use of undeclared identifier 'iostream' include<iostream> ^ main.cpp:2:1: error: expected unqualified-id using namespace std; ^ main.cpp:7:3: error: use of undeclared identifier 'cin' cin>>n; ^ main.cpp:9:5: error: use of undeclared identifier 'cin' cin>>a[i]; ^ main.cpp:12:3: error: use of undeclared identifier 'cin' cin>>c; ^ main.cpp:15:5: error: use of undeclared identifier 'cin' cin>>a>>b; ^ main.cpp:17:13: error: subscripted value is not an array, pointer, or vector ans+=a[i]; ~^~ main.cpp:19:5: error: use of undeclared identifier 'cout' cout<<ans<<endl; ^ main.cpp:19:16: error: use of undeclared identifier 'endl' cout<<ans<<endl; ^ 10 errors generated. |
include<iostream> using namespace std; int a[100]; int main(){ int n; cin>>n; for(int i=0; i<n; i++){ cin>>a[i]; } int c; cin>>c; while(c--){ int a,b,ans=0; cin>>a>>b; for(int i=a; i<=b; i++){ ans+=a[i]; } cout<<ans<<endl; } return 0; }