随笔分类 -  codeup归档

摘要:```c++ #include #include #include #include #include #include #include #include #include using namespace std; struct node { int matrix[3][3]; int step, x, y; int last[2]; }; int ans; int d_x[4] = {-1, 阅读全文
posted @ 2020-03-04 23:07 ailinal 阅读(283) 评论(0) 推荐(0)
摘要:```c++#include #include #include #include #include #include #include #include #include using namespace std;struct node { int x, y, step;};int d_x[9] = {-1, -1, 0, 1, 1, 1, 0, -1, 0};int d_y[9] = {0... 阅读全文
posted @ 2020-03-04 18:46 ailinal 阅读(151) 评论(0) 推荐(0)
摘要:```c++ #include #include #include #include #include using namespace std; int get_priority(char &op) { if (op == '+' || op == '-') return 1; if (op == '*' || op == '/') return 2; } double cul(double &a 阅读全文
posted @ 2020-03-02 21:13 ailinal 阅读(236) 评论(0) 推荐(0)
摘要:```c++ #include #include #include #include using namespace std; void convert(int in[], int len, int out[],int &ks, int m, int n) { for (int i = 0; i =0 ; --j) { printf("%d",out[j]); } printf("\n"); } 阅读全文
posted @ 2020-02-29 23:44 ailinal 阅读(114) 评论(0) 推荐(0)
摘要:```c++ #include #include #include using namespace std; int main() { int m, n; while (scanf("%d", &m) != EOF) { scanf("%d", &n); char s[1000]; scanf("%s", s); int ns = strlen(s); int a[1000]; for (int 阅读全文
posted @ 2020-02-29 23:22 ailinal 阅读(153) 评论(0) 推荐(0)
摘要:```c++ #include #include #include using namespace std; struct big_number { int d[10010], len; big_number() { memset(d, 0, sizeof(d)); len = 0; } }; big_number change(char s[]) { big_number ans; int le 阅读全文
posted @ 2020-02-29 22:29 ailinal 阅读(176) 评论(0) 推荐(0)
摘要:```c++ #include #include using namespace std; struct big_number { int d[1001], len; big_number() { memset(d, 0, sizeof(d)); len = 0; } }; big_number change(char s[]) { big_number ans; int len = strlen 阅读全文
posted @ 2020-02-28 16:28 ailinal 阅读(127) 评论(0) 推荐(0)
摘要:```c++ #include #include #include #include using namespace std; const int MAX_LEN = 100000; struct factor { int x, count; }factors[10]; int primes[MAX_LEN]; int pN=0; bool is_prime(int a){ if(a==1) re 阅读全文
posted @ 2020-02-27 17:03 ailinal 阅读(80) 评论(0) 推荐(0)
摘要:```c++#include #include #include using namespace std;void merge(int a[], int l1, int r1, int l2, int r2) { int i = l1, j = l2; int n = r2 - l1 +1; int temp[n]; int index = 0; while (i <... 阅读全文
posted @ 2020-02-22 20:01 ailinal 阅读(121) 评论(0) 推荐(0)
摘要:```c++ #include #include #include using namespace std; bool b_search(const vector &a, int x) { int left = 0, right = a.size() - 1; while (left a; for (int i = 0; i < n; ++i) { int temp; scanf("%d", &t 阅读全文
posted @ 2020-02-22 16:20 ailinal 阅读(85) 评论(0) 推荐(0)
摘要:```c++#include #include #include #include using namespace std;struct station { double per_price; double distance;};bool cmp(const station &s1, const station &s2) { return s1.distance MAX_LEN... 阅读全文
posted @ 2020-02-19 18:15 ailinal 阅读(180) 评论(0) 推荐(0)
摘要:```c++ #include #include #include using namespace std; const int N = 8; vector s; bool flag[N] = {false}; int a[N]; void help(int index) { if (index == N + 1) { for (int j = 1; j <= N; ++j) { for (int 阅读全文
posted @ 2020-02-15 23:06 ailinal 阅读(109) 评论(0) 推荐(0)
摘要:```c++ #include using namespace std; int n1; int nums[99]; int help(int i, int sum) { if (sum == 0) return 1; if (sum n1) return 0; return help(i + 1, sum - nums[i]) + help(i + 1, sum); } int main() { 阅读全文
posted @ 2020-02-15 22:27 ailinal 阅读(247) 评论(0) 推荐(0)
摘要:```c++ #include #include #include #include using namespace std; int main() { int m; while (scanf("%d", &m) != EOF) { for (int i = 0; i nums; map> group; //input int a[n]; for (int j = 0; j temp; group 阅读全文
posted @ 2020-02-14 22:46 ailinal 阅读(151) 评论(0) 推荐(0)
摘要:```c++ #include #include #include #include using namespace std; struct stu { char id[10]; int sum; }; int main() { int n, m, g; while (scanf("%d%d%d", &n, &m, &g), n) { int tab[m]; for (int i = 0; i 0 阅读全文
posted @ 2020-02-14 21:25 ailinal 阅读(111) 评论(0) 推荐(0)
摘要:```c++#include #include #include #include using namespace std;int main() { int n; while (scanf("%d", &n) != EOF) { int rsum[n]; int csum[n]; int sum1 = 0; int sum2 = ... 阅读全文
posted @ 2020-02-14 20:25 ailinal 阅读(172) 评论(0) 推荐(0)