🔥 删除 #include "sylib.h" ,删除 sylib.h

This commit is contained in:
wangfiox 2024-05-19 17:04:50 +08:00
parent 875693f977
commit f14b8f0808
177 changed files with 90 additions and 332 deletions

View File

@ -1,4 +1,3 @@
#include "sylib.h"
#define N 1024 #define N 1024
void mm(int n, int A[][N], int B[][N], int C[][N]) void mm(int n, int A[][N], int B[][N], int C[][N])

View File

@ -1,4 +1,3 @@
#include "sylib.h"
#define N 1024 #define N 1024
void mm(int n, int A[][N], int B[][N], int C[][N]) void mm(int n, int A[][N], int B[][N], int C[][N])

View File

@ -1,4 +1,3 @@
#include "sylib.h"
#define N 1024 #define N 1024
void mm(int n, int A[][N], int B[][N], int C[][N]) void mm(int n, int A[][N], int B[][N], int C[][N])

View File

@ -1,4 +1,3 @@
#include "sylib.h"
#define base 16 #define base 16
int getMaxNum(int n, int arr[]){ int getMaxNum(int n, int arr[]){

View File

@ -1,4 +1,3 @@
#include "sylib.h"
#define base 16 #define base 16
int getMaxNum(int n, int arr[]){ int getMaxNum(int n, int arr[]){

View File

@ -1,4 +1,3 @@
#include "sylib.h"
#define base 16 #define base 16
int getMaxNum(int n, int arr[]) int getMaxNum(int n, int arr[])

View File

@ -1,4 +1,3 @@
#include "sylib.h"
void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){ void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){
int i, j, k; int i, j, k;
i = 0; i = 0;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){ void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){
int i, j, k; int i, j, k;
i = 0; i = 0;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){ void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){
int i, j, k; int i, j, k;
i = 0; i = 0;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
#define mod 998244353 #define mod 998244353
int d; int d;
@ -80,4 +79,4 @@ int main(){
stoptime(); stoptime();
putarray(n + m - 1, a); putarray(n + m - 1, a);
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
#define mod 998244353 #define mod 998244353
int d; int d;
@ -80,4 +79,4 @@ int main(){
stoptime(); stoptime();
putarray(n + m - 1, a); putarray(n + m - 1, a);
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
#define mod 998244353 #define mod 998244353
int d; int d;
@ -80,4 +79,4 @@ int main(){
stoptime(); stoptime();
putarray(n + m - 1, a); putarray(n + m - 1, a);
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int sheet1[500][500] = {}; int sheet1[500][500] = {};
int sheet2[500][500] = {}; int sheet2[500][500] = {};
int active = 1; int active = 1;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int sheet1[500][500] = {}; int sheet1[500][500] = {};
int sheet2[500][500] = {}; int sheet2[500][500] = {};
int active = 1; int active = 1;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int sheet1[500][500] = {}; int sheet1[500][500] = {};
int sheet2[500][500] = {}; int sheet2[500][500] = {};
int active = 1; int active = 1;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int func(int n) { int func(int n) {
int sum = 0; int sum = 0;
int i = 200; int i = 200;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int func(int n) int func(int n)
{ {
int sum = 0; int sum = 0;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int func(int n) { int func(int n) {
int sum = 0; int sum = 0;
int i = 200; int i = 200;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
//large loop and large array caculate //large loop and large array caculate
int COUNT = 500000; int COUNT = 500000;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int COUNT = 500000; int COUNT = 500000;
float loop(float x[], float y[], int length) { float loop(float x[], float y[], int length) {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int COUNT = 100000; int COUNT = 100000;
float loop(float x[], float y[], int length) { float loop(float x[], float y[], int length) {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int a[1000][1000]; int a[1000][1000];
int b[1000][1000]; int b[1000][1000];
int c[1000][1000]; int c[1000][1000];

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int a[1000][1000]; int a[1000][1000];
int b[1000][1000]; int b[1000][1000];
int c[1000][1000]; int c[1000][1000];

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int a[1000][1000]; int a[1000][1000];
int b[1000][1000]; int b[1000][1000];
int c[1000][1000]; int c[1000][1000];

View File

@ -1,4 +1,3 @@
#include "sylib.h"
float myabs(float num) float myabs(float num)
{ {
if (num > 0) { if (num > 0) {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
float myabs(float num) { float myabs(float num) {
if(num>0){ if(num>0){
return num; return num;
@ -32,4 +31,4 @@ int main() {
putch(112); putch(112);
stoptime(); stoptime();
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
float myabs(float num) { float myabs(float num) {
if(num>0){ if(num>0){
return num; return num;
@ -32,4 +31,4 @@ int main() {
putch(112); putch(112);
stoptime(); stoptime();
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int hashmod; int hashmod;
#define maxn 10000000 #define maxn 10000000

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int hashmod; int hashmod;
#define maxn 10000000 #define maxn 10000000

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int hashmod; int hashmod;
#define maxn 10000000 #define maxn 10000000

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int x[600][600][600]; int x[600][600][600];
int y[600][600][600]; int y[600][600][600];

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int x[600][600][600]; int x[600][600][600];
int y[600][600][600]; int y[600][600][600];

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int x[600][600][600]; int x[600][600][600];
int y[600][600][600]; int y[600][600][600];

View File

@ -1,31 +0,0 @@
#ifndef __SYLIB_H_
#define __SYLIB_H_
#include <stdarg.h>
#include <stdio.h>
#include <sys/time.h>
/* Input & output functions */
int getint(), getch(), getarray(int a[]);
float getfloat();
int getfarray(float a[]);
void putint(int a), putch(int a), putarray(int n, int a[]);
void putfloat(float a);
void putfarray(int n, float a[]);
void putf(char a[], ...);
/* Timing function implementation */
struct timeval _sysy_start, _sysy_end;
#define starttime() _sysy_starttime(__LINE__)
#define stoptime() _sysy_stoptime(__LINE__)
#define _SYSY_N 1024
int _sysy_l1[_SYSY_N], _sysy_l2[_SYSY_N];
int _sysy_h[_SYSY_N], _sysy_m[_SYSY_N], _sysy_s[_SYSY_N], _sysy_us[_SYSY_N];
int _sysy_idx;
__attribute((constructor)) void before_main();
__attribute((destructor)) void after_main();
void _sysy_starttime(int lineno);
void _sysy_stoptime(int lineno);
#endif

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int matrix[20000000]; int matrix[20000000];
int a[100000]; int a[100000];
@ -52,4 +51,4 @@ int main()
putint(ans); putint(ans);
putch(10); putch(10);
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int matrix[20000000]; int matrix[20000000];
int a[100000]; int a[100000];
@ -52,4 +51,4 @@ int main()
putint(ans); putint(ans);
putch(10); putch(10);
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int matrix[20000000]; int matrix[20000000];
int a[100000]; int a[100000];
@ -52,4 +51,4 @@ int main()
putint(ans); putint(ans);
putch(10); putch(10);
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int main(){ int main(){
return 3; return 3;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
//test domain of global var define and local define //test domain of global var define and local define
int a = 3; int a = 3;
int b = 5; int b = 5;
@ -6,4 +5,4 @@ int b = 5;
int main(){ int main(){
int a = 5; int a = 5;
return a + b; return a + b;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
//test local var define //test local var define
int main(){ int main(){
int a, b0, _c; int a, b0, _c;
@ -6,4 +5,4 @@ int main(){
b0 = 2; b0 = 2;
_c = 3; _c = 3;
return b0 + _c; return b0 + _c;
} }

View File

@ -1,5 +1,4 @@
#include "sylib.h"
int a[10][10]; int a[10][10];
int main(){ int main(){
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
//test array define //test array define
int main(){ int main(){
int a[4][2] = {}; int a[4][2] = {};
@ -7,4 +6,4 @@ int main(){
int d[4][2] = {1, 2, {3}, {5}, 7 , 8}; int d[4][2] = {1, 2, {3}, {5}, 7 , 8};
int e[4][2] = {{d[2][1], c[2][1]}, {3, 4}, {5, 6}, {7, 8}}; int e[4][2] = {{d[2][1], c[2][1]}, {3, 4}, {5, 6}, {7, 8}};
return e[3][1] + e[0][0] + e[0][1] + a[2][0]; return e[3][1] + e[0][0] + e[0][1] + a[2][0];
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int main(){ int main(){
const int a[4][2] = {{1, 2}, {3, 4}, {}, 7}; const int a[4][2] = {{1, 2}, {3, 4}, {}, 7};
#define N 3 #define N 3

View File

@ -1,8 +1,7 @@
#include "sylib.h"
// test const gloal var define // test const gloal var define
const int a = 10, b = 5; const int a = 10, b = 5;
int main() int main()
{ {
return b; return b;
} }

View File

@ -1,6 +1,5 @@
#include "sylib.h"
//test const local var define //test const local var define
int main(){ int main(){
const int a = 10, b = 5; const int a = 10, b = 5;
return b; return b;
} }

View File

@ -1,6 +1,5 @@
#include "sylib.h"
const int a[5]={0,1,2,3,4}; const int a[5]={0,1,2,3,4};
int main(){ int main(){
return a[4]; return a[4];
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int a; int a;
int func(int p){ int func(int p){
p = p - 1; p = p - 1;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int defn(){ int defn(){
return 4; return 4;
} }
@ -6,4 +5,4 @@ int defn(){
int main(){ int main(){
int a=defn(); int a=defn();
return a; return a;
} }

View File

@ -1,8 +1,7 @@
#include "sylib.h"
//test add //test add
int main(){ int main(){
int a, b; int a, b;
a = 10; a = 10;
b = -1; b = -1;
return a + b; return a + b;
} }

View File

@ -1,6 +1,5 @@
#include "sylib.h"
//test addc //test addc
#define a 10 #define a 10
int main(){ int main(){
return a + 5; return a + 5;
} }

View File

@ -1,8 +1,7 @@
#include "sylib.h"
//test sub //test sub
#define a 10 #define a 10
int main(){ int main(){
int b; int b;
b = 2; b = 2;
return b - a; return b - a;
} }

View File

@ -1,7 +1,6 @@
#include "sylib.h"
//test subc //test subc
int main(){ int main(){
int a; int a;
a = 10; a = 10;
return a - 2; return a - 2;
} }

View File

@ -1,8 +1,7 @@
#include "sylib.h"
//test mul //test mul
int main(){ int main(){
int a, b; int a, b;
a = 10; a = 10;
b = 5; b = 5;
return a * b; return a * b;
} }

View File

@ -1,6 +1,5 @@
#include "sylib.h"
//test mulc //test mulc
#define a 5 #define a 5
int main(){ int main(){
return a * 5; return a * 5;
} }

View File

@ -1,8 +1,7 @@
#include "sylib.h"
//test div //test div
int main(){ int main(){
int a, b; int a, b;
a = 10; a = 10;
b = 5; b = 5;
return a / b; return a / b;
} }

View File

@ -1,6 +1,5 @@
#include "sylib.h"
//test divc //test divc
#define a 10 #define a 10
int main(){ int main(){
return a / 5; return a / 5;
} }

View File

@ -1,7 +1,6 @@
#include "sylib.h"
//test mod //test mod
int main(){ int main(){
int a; int a;
a = 10; a = 10;
return a / 3; return a / 3;
} }

View File

@ -1,7 +1,6 @@
#include "sylib.h"
//test rem //test rem
int main(){ int main(){
int a; int a;
a = 10; a = 10;
return a % 3; return a % 3;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
// test if-else-if // test if-else-if
int ifElseIf() { int ifElseIf() {
int a; int a;
@ -23,4 +22,4 @@ int ifElseIf() {
int main(){ int main(){
putint(ifElseIf()); putint(ifElseIf());
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
// test if-if-else // test if-if-else
int ififElse() { int ififElse() {
int a; int a;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
// test if-{if-else} // test if-{if-else}
int if_ifElse_() { int if_ifElse_() {
int a; int a;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
// test if-{if}-else // test if-{if}-else
int if_if_Else() { int if_if_Else() {
int a; int a;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int get_one(int a) { int get_one(int a) {
return 1; return 1;
} }
@ -29,4 +28,4 @@ int main() {
p = deepWhileBr(p, p); p = deepWhileBr(p, p);
putint(p); putint(p);
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int doubleWhile() { int doubleWhile() {
int i; int i;
i = 5; i = 5;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int FourWhile() { int FourWhile() {
int a; int a;
a = 5; a = 5;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int g; int g;
int h; int h;
int f; int f;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
//test break //test break
int main(){ int main(){
int i; int i;
@ -13,4 +12,4 @@ int main(){
i = i + 1; i = i + 1;
} }
return sum; return sum;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
//test continue //test continue
int main(){ int main(){
int i; int i;
@ -14,4 +13,4 @@ int main(){
i = i + 1; i = i + 1;
} }
return sum; return sum;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
// test while-if // test while-if
int whileIf() { int whileIf() {
int a; int a;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int ifWhile() { int ifWhile() {
int a; int a;
a = 0; a = 0;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int deepWhileBr(int a, int b) { int deepWhileBr(int a, int b) {
int c; int c;
c = a + b; c = a + b;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
#define N -1 #define N -1

View File

@ -1,4 +1,3 @@
#include "sylib.h"
//test the priority of add and mul //test the priority of add and mul
int main(){ int main(){
int a, b, c, d; int a, b, c, d;
@ -7,4 +6,4 @@ int main(){
c = 2; c = 2;
d = 2; d = 2;
return c + a * b - d; return c + a * b - d;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
//test the priority of add and mul //test the priority of add and mul
int main(){ int main(){
int a, b, c, d; int a, b, c, d;
@ -7,4 +6,4 @@ int main(){
c = 2; c = 2;
d = 2; d = 2;
return (c + a) * (b - d); return (c + a) * (b - d);
} }

View File

@ -1,8 +1,7 @@
#include "sylib.h"
//test the priority of unary operator and binary operator //test the priority of unary operator and binary operator
int main(){ int main(){
int a, b; int a, b;
a = 10; a = 10;
b = 30; b = 30;
return a - -5 + b + -5; return a - -5 + b + -5;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int a; int a;
int b; int b;
int c; int c;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int a = 1; int a = 1;
int b = 0; int b = 0;
int c = 1; int c = 1;
@ -13,4 +12,4 @@ int main()
} }
putint(flag); putint(flag);
return flag; return flag;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int main() { int main() {
int a; int a;
a = 10; a = 10;
@ -9,4 +8,4 @@ int main() {
a = 0; a = 0;
} }
return a; return a;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int main() { int main() {
int a, b; int a, b;
a = 070; a = 070;
@ -12,4 +11,4 @@ int main() {
} }
putint(a); putint(a);
return 0; return 0;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int main() { int main() {
int a = 10; int a = 10;
; ;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int a; int a;
int b; int b;
int main() int main()

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int k; int k;
#define n 10 #define n 10
int main () { int main () {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
//test comment //test comment
int main(){ int main(){
int a; int a;
@ -10,4 +9,4 @@ int main(){
// b = 2 // b = 2
*/ */
return a; return a;
} }

View File

@ -1,7 +1,6 @@
#include "sylib.h"
// test hexadecimal define // test hexadecimal define
int main(){ int main(){
int a; int a;
a = 0xf; a = 0xf;
return a; return a;
} }

View File

@ -1,8 +1,7 @@
#include "sylib.h"
//test add of hex and oct //test add of hex and oct
int main(){ int main(){
int a, b; int a, b;
a = 0xf; a = 0xf;
b = 0xc; b = 0xc;
return a + b + 075; return a + b + 075;
} }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
// Use complex expression in assign structure // Use complex expression in assign structure
int main () { int main () {
int a; int a;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
// Use complex expression in if structure // Use complex expression in if structure
int main () { int main () {
int a; int a;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int g = 0; int g = 0;
int func(int n) { int func(int n) {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int a, b, d; int a, b, d;
int set_a(int val) { a = val; return a; } int set_a(int val) { a = val; return a; }

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int a = 7; int a = 7;
int func() { int func() {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int k; int k;
int main() { int main() {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int b = 5; int b = 5;
int c[4] = {6, 7, 8, 9}; int c[4] = {6, 7, 8, 9};

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int n; int n;
int bubblesort(int arr[]) int bubblesort(int arr[])
{ {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int n; int n;
int insertsort(int a[]) int insertsort(int a[])
{ {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int n; int n;
int QuickSort(int arr[], int low, int high) int QuickSort(int arr[], int low, int high)
{ {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int n; int n;
int select_sort(int A[],int n) int select_sort(int A[],int n)
{ {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int n; int n;
int swap (int array[], int i, int j){ int swap (int array[], int i, int j){
int temp; int temp;

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int n; int n;
int counting_sort(int ini_arr[], int sorted_arr[], int n) { int counting_sort(int ini_arr[], int sorted_arr[], int n) {

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int buf[2][100]; int buf[2][100];
// sort [l, r) // sort [l, r)

View File

@ -1,4 +1,3 @@
#include "sylib.h"
int array[110]; int array[110];
int n; int n;
void init(int n) { void init(int n) {

Some files were not shown because too many files have changed in this diff Show More