Submission #19764

# Submission time Handle Problem Language Result Execution time Memory
19764 2016-02-25T05:23:07 Z camille 창문 (kriii4_C) C++
3 / 100
1000 ms 1720 KB
#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;
typedef long long lld;

lld a,b,mod=1e9+7,ret,s,c;


lld foo(lld idx){
    if(idx==1) return s;
    lld k = foo(idx/2)%mod;
    if(idx%2) return (((k*k)%mod)*s)%mod;
    return (k*k)%mod;
}



int main(){
    cin>>a>>b;
    
    s = ((a*(a+1))/2) * ((b*(b+1))/2);
    s%=mod;
    c=foo(1e9+5)%mod;
   
    
    for(lld dy=0; dy<a; dy++){
        for(lld dx=0; dx<b; dx++){
            for(lld ky=1; ky<=a; ky++){
                for(lld kx=1; kx<=b; kx++){
                    if(dy+ky>a || dx+kx>b) break;
                    ret+=(ky)*(kx)*9;
                    ret%=mod;
                }
            }
        }
    }
    cout<<(ret*c)%mod<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1720 KB Output is correct
2 Correct 0 ms 1720 KB Output is correct
3 Correct 0 ms 1720 KB Output is correct
4 Correct 0 ms 1720 KB Output is correct
5 Correct 14 ms 1720 KB Output is correct
6 Correct 0 ms 1720 KB Output is correct
7 Correct 9 ms 1720 KB Output is correct
8 Correct 0 ms 1720 KB Output is correct
9 Correct 2 ms 1720 KB Output is correct
10 Correct 0 ms 1720 KB Output is correct
11 Correct 0 ms 1720 KB Output is correct
12 Correct 0 ms 1720 KB Output is correct
13 Correct 11 ms 1720 KB Output is correct
14 Correct 2 ms 1720 KB Output is correct
15 Correct 11 ms 1720 KB Output is correct
16 Correct 12 ms 1720 KB Output is correct
17 Correct 29 ms 1720 KB Output is correct
18 Correct 30 ms 1720 KB Output is correct
19 Correct 30 ms 1720 KB Output is correct
20 Correct 31 ms 1720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 1716 KB Program timed out
2 Halted 0 ms 0 KB -