Commit 78a60f29 authored by lxq's avatar lxq

add 2 cases

parent 7e736683
void main(void) {
int c;
int a;
int b;
int d;
int f;
int g;
int loopCnt;
loopCnt = input();
c = 0;
a = 0;
g = 0;
while (c < loopCnt) {
a = 1.23456 * 5.73478 * 2.3333 * 4.3673 * 6.34636;
b = a * a * a * a * a * a;
d = b * b * b * b * b * b;
f = d * d * d * d * d * d;
g = f * f * f * f * f * f;
c = c + 1;
}
output(g);
return;
}
\ No newline at end of file
int matrix[20000000];
int ad[100000];
int len;
void readarray(void) {
int cnt;
cnt = 0;
while (cnt < len) {
ad[cnt] = input();
cnt = cnt + 1;
}
}
int transpose(int n, int matrix[], int rowsize) {
int colsize;
int i;
int j;
int curr;
colsize = n / rowsize;
i = 0;
j = 0;
while (i < colsize) {
j = 0;
while (j < rowsize) {
if (i < j) {
j = j + 1;
} else {
curr = matrix[i * rowsize + j];
matrix[j * colsize + i] = matrix[i * rowsize + j];
matrix[i * rowsize + j] = curr;
j = j + 1;
}
}
i = i + 1;
}
return 0 - 1;
}
int main(void) {
int n;
int i;
int ans;
n = input();
len = input();
readarray();
i = 0;
while (i < n) {
matrix[i] = i;
i = i + 1;
}
i = 0;
while (i < len) {
transpose(n, matrix, ad[i]);
i = i + 1;
}
ans = 0;
i = 0;
while (i < len) {
ans = ans + i * i * matrix[i];
i = i + 1;
}
if (ans < 0) {
ans = 0 - ans;
}
output(ans);
return 0;
}
10000000
30
2
5
4
25
8
125
16
625
32
3125
2
5
4
25
8
125
16
625
32
3125
2
5
4
25
8
125
16
625
32
3125
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment