Codeforces Round #319 (Div. 2)A Multiplication Table
来源:互联网 发布:建筑建模软件 编辑:程序博客网 时间:2024/06/14 23:48
思路:水题
#include<bits\stdc++.h>using namespace std;int main(){int n,x;cin >> n >>x;int ans = 0;for(int i = 1;i<=n;i++){ if(x%i==0&&x/i<=n)ans++;}cout <<ans <<endl;}
A. Multiplication Table
time limit per test
1 secondmemory limit per test
256 megabytesinput
standard inputoutput
standard outputLet's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row and j-th column contains number i × j. The rows and columns are numbered starting from 1.
You are given a positive integer x. Your task is to count the number of cells in a table that contain number x.
Input
The single line contains numbers n and x (1 ≤ n ≤ 105, 1 ≤ x ≤ 109) — the size of the table and the number that we are looking for in the table.
Output
Print a single number: the number of times x occurs in the table.
Examples
input
10 5
output
2
input
6 12
output
4
input
5 13
output
0
Note
A table for the second sample test is given below. The occurrences of number 12 are marked bold.
![](http://codeforces.com/predownloaded/73/96/7396f9adf8eaaf460e1588505b9c25ae438f0e8a.png)
0 0
- Codeforces Round #319 (Div. 2) 577A Multiplication Table(脑洞)
- Codeforces Round #319 (Div. 2)A Multiplication Table
- Codeforces #319(Div.2) A. Multiplication Table
- Codeforces Round #256 (Div. 2)——Multiplication Table
- Codeforces Round #256 (Div. 2) D. Multiplication Table
- Codeforces Round #256 (Div. 2) D. Multiplication Table
- Codeforces Round #256 (Div. 2) D. Multiplication Table 二分
- Codeforces Round #256 (Div. 2) D. Multiplication Table
- Codeforces Round #256 (Div. 2) D. Multiplication Table
- Codeforces Round #256 (Div. 2) D. Multiplication Table
- Codeforces Round #256 (Div. 2) D Multiplication Table (二分)
- Codeforces Round #256 (Div. 2) D. Multiplication Table 【二分】
- codeforces Round 256(Div.2)D.Multiplication Table(二分)
- Codeforces Round #209 (Div. 2) A. Table
- Codeforces Round #209 (Div. 2) A.Table
- CF Codeforces Round #256 (Div. 2) D (448D) Multiplication Table
- Codeforces Round #256 (Div. 2) D. Multiplication Table(二分查找)
- Codeforces Round #256 (Div. 2) D Multiplication Table(很巧妙二分)
- vim配置教程及效果图
- 链表相关算法总结
- C++中能否通过内嵌汇编修改const常量的值?
- 【实践派】Java实例的内存占用测试(一)
- 经典冒泡排序,数值升序排列
- Codeforces Round #319 (Div. 2)A Multiplication Table
- 深海机器人问题[网络流24题之20]
- Android 自定义控件学习之二 简单布局实例
- stm32f10x学习二 存储器组织
- 剑指offer20--栈的压入,弹出序列
- 正则表达式
- Apriori算法简介---关联规则的频繁项集算法
- debian-Python-pip安装失败问题解决
- Java中构造函数的作用