Pagini recente » Cod sursa (job #1962282) | Cod sursa (job #78960) | Cod sursa (job #2116220) | Cod sursa (job #1119144) | Cod sursa (job #1488254)
/*#include <bits/stdc++.h>
using namespace std;
const int nmax = 50005;
vector <pair<int,int> > g[nmax];
bool viz[nmax];
int n, m, gr, sol[nmax];
void bfs()
{
queue <int> q;
int i, dad, son, cost;
q.push(1);
while(!q.empty())
{
dad=q.front();
q.pop();
viz[dad]=1;
for(i=0; i<g[dad].size(); i++)
{
son=g[dad][i].first;
cost=g[dad][i].second;
if(!viz[son])
{
if(sol[son]>0) sol[son]=min(sol[son], sol[dad]+1);
else if(cost>gr) sol[son]=sol[dad]+1;
q.push(son);
}
}
}
}
int main()
{
freopen("camionas.in", "r", stdin);
freopen("camionas.out", "w", stdout);
int x, y, c, i;
scanf("%d %d %d", &n, &m, &gr);
while(m--)
{
scanf("%d %d %d", &x, &y, &c);
g[x].push_back(make_pair(y, c));
g[y].push_back(make_pair(x, c));
}
bfs();
printf("%d", sol[n]);
return 0;
}*/
#include <stdio.h>
#include <stdlib.h>
using namespace std;
FILE *in, *out;
int a, b;
int main()
{
in = fopen("adunare.in","rt");
out = fopen("adunare.out","wt");
fscanf(in, "%d %d",&a,&b);
fprintf(out, "%d", a+b);
return 0;
}