摘要:
A. Reachable Numbers 代码: #include <bits/stdc++.h> using namespace std; const int maxn = 1e9 + 7; int N; set<int> s; int main() { scanf("%d", &N); whil 阅读全文
摘要:
A.2016 给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1. 1≤a≤n,1≤b≤m; 2. a×b 是 2016 的倍数。 Input 输入包含不超过 30 组数据。 每组数据包含两个整数 n,m (1≤n,m≤10 9). Output对于每组数据,输出一个整数表 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=3486 Problem Description YaoYao has a company and he wants to employ m people recently. Since his company is 阅读全文
摘要:
A. Neko Finds Grapes 代码: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int N, M; int a[maxn], b[maxn]; int odda = 0, evea = 阅读全文
摘要:
http://poj.org/problem?id=1050 Description Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-arra 阅读全文
摘要:
解决区间查询最大值最小值的问题 用 $O(N * logN)$ 的复杂度预处理 查询的时候只要 $O(1)$ 的时间 这个算法是 real 小清新了 有一个长度为 N 的数组进行 M 次查询 可以查询区间最大值和最小值 阅读全文
摘要:
A. Reverse a Substring 代码: #include <bits/stdc++.h> using namespace std; int N; string s; int main() { scanf("%d", &N); cin >> s; int temp = -1; for(i 阅读全文
摘要:
A - Taxi Fare Last September, Hangzhou raised the taxi fares. The original flag-down fare in Hangzhou was 10 yuan, plusing 2 yuan per kilometer after 阅读全文
摘要:
https://leetcode.com/problems/largest-rectangle-in-histogram/ Given n non-negative integers representing the histogram's bar height where the width of 阅读全文
摘要:
A. Middle of the Contest 代码: #include <bits/stdc++.h> using namespace std; int h1, m1, h2, m2; int tim1 = 0, tim2 = 0; int main() { scanf("%d:%d", &h1 阅读全文