Submission #975938

#TimeUsernameProblemLanguageResultExecution timeMemory
975938vjudge1Trol (COCI19_trol)C++17
0 / 50
1 ms500 KiB
#include <bits/stdc++.h>
#define int long long
#define ld long double
using namespace std;
const int N=1e9;

signed main(){
    int p=pow(2,60);
    int angka[p];
    for (int i=1;i<=p;i++){
        angka[i]=i;
    }
    int a; cin>>a;
    for(int i=0;i<a;i++){
        int x,y,ans=0; cin>>x>>y;
        if(x>y){
            return 0;
        }
        for(int j=x;j<=y;j++){
            int wawo;
            wawo=angka[j]%9;
            ans+=wawo;
        }
        cout<<ans<<endl;
    }
}

Compilation message (stderr)

trol.cpp: In function 'int main()':
trol.cpp:9:9: warning: argument to variable-length array is too large [-Wvla-larger-than=]
    9 |     int angka[p];
      |         ^~~~~
trol.cpp:9:9: note: limit is 9223372036854775807 bytes, but argument is 9223372036854775808
#Verdict Execution timeMemoryGrader output
Fetching results...