1325 条题解
-
-1
a1ioua LV 4 @ 4 年前
最短代码挑战
print sum(map(int, raw_input().split()))
-
-14 年前@
python的解法,使用map函数才可以。如果使用
x=int(input())
y=int(input())
print(x+y)
这种简单的思维不行,递交出错。
要使用如下代码中: -
-14 年前@
-
-14 年前@
新手都能学会的简易卡常a+b
-
-14 年前@
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
cout << a + b << endl;
} -
-14 年前@
最简单的题?按题目模拟即可
-
-14 年前@
#include<bits/stdc++.h>
#define gou int main()
#define li {
#define guo int a,b;
#define jia cin>>a>>b;
#define sheng cout<<a+b;
#define si return 0;
#define yi }
using namespace std;
gou
li
guo
jia
sheng
si
yi -
-14 年前@
C
c++
-
-14 年前@
#include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
return 0;
} -
-14 年前@
哇!终于找到了一道那么难的LCT题目!!!
赶紧来写一个Link-Cut Tree题解! -
-14 年前@
-
-14 年前@
都正常点!
俗话说得好,装*遭**(光速逃
下面是正经A+B
C++语言 -
-14 年前@
-
-14 年前@
更666:
print(int(input())+int(input())
-
-14 年前@
#include<iostream>
using namespace std;
int n,cnt,m;
int main(){
cin>>n>>m;
cout<<n+m;
} -
-14 年前@
最小生成树最好了
```cpp
#include <cstdio>
#include <algorithm>
#define INF 2140000000
using namespace std;
struct tree{int x,y,t;}a[10];
bool cmp(const tree&a,const tree&b){return a.t<b.t;}
int f[11],i,j,k,n,m,x,y,t,ans;
int root(int x){if (f[x]==x) return x;f[x]=root(f[x]);return f[x];}
int main(){
for (i=1;i<=10;i++) f[i]=i;
for (i=1;i<=2;i++){
scanf("%d",&a[i].t);
a[i].x=i+1;a[i].y=1;k++;
}
a[++k].x=1;a[k].y=3,a[k].t=INF;
sort(a+1,a+1+k,cmp);
for (i=1;i<=k;i++){
// printf("%d %d %d %d\n",k,a[i].x,a[i].y,a[i].t);
x=root(a[i].x);y=root(a[i].y);
if (x!=y) f[x]=y,ans+=a[i].t;
}
printf("%d\n",ans);
} -
-14 年前@
1
-
-14 年前@
再也简单不过的题了
-
-14 年前@
各位,请不要误导新人。。。
Python代码:
-
-14 年前@
递推即可
信息
- ID
- 1000
- 难度
- 9
- 分类
- (无)
- 标签
- (无)
- 递交数
- 74700
- 已通过
- 28590
- 通过率
- 38%
- 被复制
- 239