ll ju = 1e9,ju2=1e18;
int p[1050], cnt;
bool vis[1050];
vector<ll> v,v2;
const ll mp[22] = { 53,89,131,167,199,//每次询问最大的质数的后面一个 241,281,331,373,409,443,479,521,569,601,641 };
void x_x()
{f(i, 2, 1000){if (!vis[i])p[++cnt] = i;for (int j = 1;p[j] <= 1000 / i;j++){vis[p[j] * i] = true;if (i%p[j] == 0)break;}}int j = 1;while(j<=cnt){ll res = 1;while(j<=cnt){if (ju2 / p[j] < res)break;res *= p[j];j++;}v2.emplace_back(res);}f(i, 1, 168){ll now = p[i];while (now < ju/p[i])now *= p[i];v.emplace_back(now);}
}
ll query(ll now)
{printf("? %lld", now);cout << endl;ll ans;scanf("%lld", &ans);return ans;
}
void print(ll ans)
{printf("! %lld", ans);cout << endl;
}
void work()
{ll ans = 1, remain = 1e9, fg = 22;for(int i=0;i<22&&fg>0;i++){fg--;if (fg<=0)break;ll tmp = query(v2[i]);vector<int> have;f(j, 1, 168){if (tmp%p[j] == 0)have.emplace_back(j);}for (auto I : have){fg--;ll now = query(v[I - 1]);remain /= now; int cot = 0;while (now%p[I] == 0){now /= p[I];cot++;}ans *= (cot + 1);if (fg <= 0)break;}if (fg<=0)break;if (remain < (mp[i] * mp[i] * mp[i]))break;}print(ans * 2);
}
int main()
{//freopen("in.txt", "r", stdin);x_x();int t;cin >> t;while (t--){work();}return 0;
}
详细解决方案
F. Guess Divisors Count(数论构造)
热度:96 发布时间:2024-02-06 12:33:54.0
相关解决方案
- 急求帮忙!mysql 【 Column count doesn't match value count 】,该怎么解决
- Ibatis 查询话语selec count(*),getSqlMapClientTemplate().后面应该接什么
- select count(*)as num from hall where Hall_No=10000001关于这个SQL语句,怎么取出返回的数字
- 关于httpWebRequest请求失败异常:The specified call count is not a number
- linq 中 g.first()怎么跟g.count() 连用啊
- repeater中有底据为什么items.count=0呢
- 求答案 GridView1.Rows.Count 一直等于0解决思路
- ds.Tables[0].Rows.Count 能查到0表 但count=0 sql语句没有关问题
- DataList怎么统计出数据库的记录数,类似GridView.Rows.Count
- DataGrid绑定时DataView时,DataView.Count()为237或259行,为什么绑定后,界面上一直只有24行?解决方法
- 请教?Int((DataView.Count+9)\10)是什么意思
- 在有几百万条数据表里使用SQL COUNT 函数计算太慢如何解决
- ,select count(*) 查询结果为空,而不是所需要的0
- GridView1.Columns.count 如何会为0
- count()函数用ExecuteScalar执行时,查到的数据库中记录数如何像是随机数啊
- 是这样写吗? Library.Take(count).Where(a => a.Status==status)
- 蛇年万事大吉!Public Property Name As String = "kkk" & [color=#FF0000]nf.Users.Count[
- sql count()一张表里的结果做为一列加到select语句里解决方法
- count(case when.distinct 解决方法
- DB2 count(*),count(一)区别
- select count(*) from db2解决办法
- DB2 count(*),count(1)区别,该怎么处理
- 为什么小弟我的select count(*) from行报错呢,大家帮小弟我看看,多谢了
- count,该如何解决
- select count()查询性能差,请
- come on, guess that what 's the meanning of the phrase 'a long shot'解决方法
- come on, guess that what 's the meanning of the phrase 'a long shot'.解决方案
- SVN异常:Thread attempted to read nesting count of a lock it did not own
- jquerymobile-10 替list添加数字气泡(count bubbles)
- count(*)用什么该?