这几个用例有问题

This commit is contained in:
wangfiox 2024-08-10 12:48:33 +08:00
parent bac07b060e
commit 925d90c389
7 changed files with 3293 additions and 1 deletions

1
.gitignore vendored
View File

@ -7,4 +7,5 @@ build
**/log **/log
**/output **/output
**/*.toml **/*.toml
**/diff
zci.toml zci.toml

1000
dbg/input/matmul1.in Normal file

File diff suppressed because it is too large Load Diff

1000
dbg/input/matmul2.in Normal file

File diff suppressed because it is too large Load Diff

1000
dbg/input/matmul3.in Normal file

File diff suppressed because it is too large Load Diff

97
dbg/sy/matmul1.sy Normal file
View File

@ -0,0 +1,97 @@
int a[1000][1000];
int b[1000][1000];
int c[1000][1000];
const int MAX = 2147483647;
int main(){
int n;
int i;
int j;
int k;
int sum = 0;
i = 0;
while(i<1000)
{
n = getarray(a[i]);
if(n!=1000){
return n;
}
i = i + 1;
}
starttime();
i = 0;
while(i<1000){
j = 0;
while(j<1000){
b[i][j] = a[j][i];
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
while(j<1000){
k = 0;
int temp = 0;
while(k<1000){
temp = temp + a[i][k]*b[k][j];
k = k+1;
}
c[i][j] = temp;
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
int temp = MAX;
while(j<1000){
if(c[i][j]<temp)
{
temp = c[i][j];
}
j = j+1;
}
j = 0;
while(j<1000){
c[i][j] = temp;
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
int temp = MAX;
while(j<1000){
c[i][j] = -c[j][i];
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
int temp = MAX;
while(j<1000){
sum = sum + c[i][j];
j = j+1;
}
i = i+1;
}
stoptime();
putint(sum);
return 0;
}

97
dbg/sy/matmul2.sy Normal file
View File

@ -0,0 +1,97 @@
int a[1000][1000];
int b[1000][1000];
int c[1000][1000];
const int MAX = 2147483647;
int main(){
int n;
int i;
int j;
int k;
int sum = 0;
i = 0;
while(i<1000)
{
n = getarray(a[i]);
if(n!=1000){
return n;
}
i = i + 1;
}
starttime();
i = 0;
while(i<1000){
j = 0;
while(j<1000){
b[i][j] = a[j][i];
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
while(j<1000){
k = 0;
int temp = 0;
while(k<1000){
temp = temp + a[i][k]*b[k][j];
k = k+1;
}
c[i][j] = temp;
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
int temp = MAX;
while(j<1000){
if(c[i][j]<temp)
{
temp = c[i][j];
}
j = j+1;
}
j = 0;
while(j<1000){
c[i][j] = temp;
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
int temp = MAX;
while(j<1000){
c[i][j] = -c[j][i];
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
int temp = MAX;
while(j<1000){
sum = sum + c[i][j];
j = j+1;
}
i = i+1;
}
stoptime();
putint(sum);
return 0;
}

97
dbg/sy/matmul3.sy Normal file
View File

@ -0,0 +1,97 @@
int a[1000][1000];
int b[1000][1000];
int c[1000][1000];
const int MAX = 2147483647;
int main(){
int n;
int i;
int j;
int k;
int sum = 0;
i = 0;
while(i<1000)
{
n = getarray(a[i]);
if(n!=1000){
return n;
}
i = i + 1;
}
starttime();
i = 0;
while(i<1000){
j = 0;
while(j<1000){
b[i][j] = a[j][i];
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
while(j<1000){
k = 0;
int temp = 0;
while(k<1000){
temp = temp + a[i][k]*b[k][j];
k = k+1;
}
c[i][j] = temp;
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
int temp = MAX;
while(j<1000){
if(c[i][j]<temp)
{
temp = c[i][j];
}
j = j+1;
}
j = 0;
while(j<1000){
c[i][j] = temp;
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
int temp = MAX;
while(j<1000){
c[i][j] = -c[j][i];
j = j+1;
}
i = i+1;
}
i = 0;
while(i<1000){
j = 0;
int temp = MAX;
while(j<1000){
sum = sum + c[i][j];
j = j+1;
}
i = i+1;
}
stoptime();
putint(sum);
return 0;
}