Advertisement
hasib_mo

Untitled

Mar 17th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.97 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cstring>
  4. #include<cstdlib>
  5. #include<cmath>
  6.  
  7. #include<algorithm>
  8. #include<vector>
  9. #include<string>
  10. #include<stack>
  11. #include<queue>
  12. #include<map>
  13. #include<sstream>
  14.  
  15.  
  16.  
  17. #define FOR(i, s, e) for(int i=s; i<e; i++)
  18. #define loop(i, n) for(int i=0; i<n; i++)
  19. #define getint(n) scanf("%d", &n)
  20. #define pb(a) push_back(a)
  21. #define ll long long
  22. #define SZ(a) int(a.size())
  23. #define read() freopen("input.txt", "r", stdin)
  24. #define write() freopen("output.txt", "w", stdout)
  25. #define mem(a, v) memset(a, v, sizeof(a))
  26. #define all(v) v.begin(), v.end()
  27. #define pi acos(-1.0)
  28. #define INF 10000000000
  29. #define mod abs
  30. #define pf printf
  31. #define sf scanf
  32.  
  33. #define MAXX 1000 + 2
  34.  
  35. using namespace std;
  36.  
  37. char input[MAXX];
  38. int graph[MAXX];
  39. int len;
  40.  
  41. struct DATA{
  42.     int position, ampm, porishrom;
  43.     void set(int ap, int rt)
  44.     {
  45.         ampm = ap;
  46.         porishrom = rt;
  47.     }
  48. };
  49.  
  50.  
  51. int bfs()
  52. {
  53.     bool visited[MAXX][13][16];
  54.     mem(visited, 0);
  55.     DATA u, v;
  56.     u.position = 0;
  57.     u.set(0, 0);
  58.     visited[0][0][0] = true;
  59.     queue<DATA>Q;
  60.     Q.push(u);
  61.     while( !Q.empty() )
  62.     {
  63.         u = Q.front();
  64.         if(u.position % 2 == 0)
  65.         {//diner bela
  66.            
  67.         }
  68.  
  69.     }
  70.  
  71. }
  72.  
  73.  
  74. int main()
  75. {
  76.     int kases;
  77.     getint(kases);
  78.  
  79.     while(kases--)
  80.     {
  81.         cin>>input;
  82.         len = strlen(input) - 1;
  83.         int it = 0;
  84.         graph[0] = 0;
  85.  
  86.         FOR(i, 1, len)
  87.         {
  88.             if(input[i] == '.')
  89.             {
  90.                 if(it % 2 == 1)
  91.                 {
  92.                     it++;
  93.                     graph[it] = 0;
  94.                 }
  95.                 graph[it]++;
  96.             }
  97.             else
  98.             {
  99.                 if(it % 2 == 0)
  100.                 {
  101.                     it++;
  102.                     graph[it] = 0;
  103.                 }
  104.                 graph[it]++;
  105.             }
  106.         }
  107.         len = it;
  108.  
  109.  
  110.     }
  111.  
  112.     return 0;
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement