답안 #975938

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
975938 2024-05-06T03:41:02 Z vjudge1 Trol (COCI19_trol) C++17
0 / 50
1 ms 500 KB
#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

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
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Runtime error 1 ms 348 KB Execution killed with signal 11
3 Runtime error 1 ms 348 KB Execution killed with signal 11
4 Runtime error 1 ms 348 KB Execution killed with signal 11
5 Runtime error 1 ms 500 KB Execution killed with signal 11