Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: C++  |  size: 0.33 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # include <iostream>
  2. # include <vector>
  3. # include <cstdio>
  4. vector <int> v[100];
  5. using namespace std;
  6. int main ()
  7. {
  8.         freopen ("1.txt","r",stdin);
  9.         int n,m;
  10.         scanf("%d%d", &n,&m);
  11.         for (int i=0;i<m;i++)
  12.         {
  13.                 int q,w;
  14.                 scanf("%d%d",&q,&m);
  15.                 v[q].push_back (w);
  16.                 v[w].push_back (q);
  17.         }
  18.         cout<<v[1][0];
  19.         return 0;
  20. }