首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
岸上的乌龟
2026年3月11日 09:30
将军的书 题解:简单易理解,用string输入,将二进制字符串转换成整
P1118
回复 0
|
赞 2
|
浏览 76
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n){ int sum=0; int x,j,len; string s; for(int i=1;i<po...
yauqq
2026年3月9日 12:57
将军的书 题解:二分 注意页数下标从0开始
P1118
回复 0
|
赞 0
|
浏览 45
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll binToDec(const string &s) { if (s.empty()) return 0; ll res = 0; for (char c : s) res = res * 2 + (c - '0'); return res; } int main(){ int n; while(cin >> n){ ll m = (1 <...
18333626898
2025年7月13日 15:24
将军的书 题解:map
P1118
回复 0
|
赞 2
|
浏览 776
#include<bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define INF 0x3f3f3f3f const int N=1e6+10; map<int,int> m; signed main() { ios::sync_with_stdio(0); cin.tie(0);  ...
滴滴答答
2021年7月17日 17:15
仅供参考
P1118
回复 0
|
赞 8
|
浏览 7.6k
#include<bits/stdc++.h> using namespace std; int main() { bitset<22>num; long i,N,res; while(cin>>N) { N=(1<<N)-1; for(i=res=0; i<N; ++i) { cin>>num; res^=num.to_ulong(); } ...
莫小七
2020年3月27日 22:48
1118 将军的书
P1118
回复 0
|
赞 12
|
浏览 13.0k
#include<iostream> #include<cmath> #include<string> using namespace std; int change(string s){//将字符串转化成数字 int num = 0; for(int i=0;i<s.size();i++){ num = num * 2 + (s[i]-'0'); } return num; } int main(){ int n; int num = 0; string s; while(cin...
myhy001
2020年2月6日 18:11
帮我看看哪里错了
P1118
回复 1
|
赞 2
|
浏览 10.1k
#include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> int main() { int n; while(scanf("%d",&n)!=EOF) { int sum=(int)pow(2,n),i; int a[su...
题目
将军的书
题解数量
6
发布题解
在线答疑
热门题解
1
1118 将军的书
2
仅供参考
3
将军的书 题解:简单易理解,用string输入,将二进制字符串转换成整数
4
将军的书 题解:map
5
帮我看看哪里错了
6
将军的书 题解:二分 注意页数下标从0开始