hdu 5567 sequence1(水)
2015-12-03 20:49
501 查看
题目链接:hdu 5567 sequence1
代码
#include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; const int maxn = 105; int main () { int n, a[maxn], b, c; while (scanf("%d%d%d", &n, &b, &c) == 3) { for (int i = 0; i < n; i++) scanf("%d", &a[i]); int ans = 0; for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) if (abs(a[i] - a[j]) % b == c) ans++; printf("%d\n", ans); } return 0; }
相关文章推荐
- iOS之UI随笔-UITableView的性能优化
- UI基础3 UIControl
- Luence 课程1----索引和搜索的建立
- Hint:Parameter 'in' is declared but never used in 'query_student'
- iOS开发之UIViewController属性
- iOS-UI父视图下视图的操作
- iOS UITabBarController 的 UITabBar 自定义
- zoj 2587 Unique Attack 最小割判定
- Android获取Bluetooth设备信号RSSI值得流程
- hdu 2454 Degree Sequence of Graph G
- jenkins job build本地安装说明
- iOS之UIcollectionView
- UIScrollView的setContentOffset方法
- SPOJ GSS2 Can you answer these queries II
- UI通讯录
- iOS开发之UIButton
- UI第十六天:⺴络编程
- iOS_UITabBarController 标签视图控制器
- iOS 开发 中级:UIToolbar,UINavigationBar,UITabBar,UIBarButtonItem,UITabBarItem自定义方法总结
- UITabBarController的每个item的title如何不占位置