Cod sursa(job #1488254)

Utilizator tudormaximTudor Maxim tudormaxim Data 18 septembrie 2015 11:48:03
Problema A+B Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 1.28 kb
/*#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;
}