Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdio>
- #include<cstring>
- #include<cstdlib>
- #include<cmath>
- #include<algorithm>
- #include<vector>
- #include<string>
- #include<stack>
- #include<queue>
- #include<map>
- #include<sstream>
- #define FOR(i, s, e) for(int i=s; i<e; i++)
- #define loop(i, n) for(int i=0; i<n; i++)
- #define getint(n) scanf("%d", &n)
- #define pb(a) push_back(a)
- #define ll long long
- #define SZ(a) int(a.size())
- #define read() freopen("input.txt", "r", stdin)
- #define write() freopen("output.txt", "w", stdout)
- #define mem(a, v) memset(a, v, sizeof(a))
- #define all(v) v.begin(), v.end()
- #define pi acos(-1.0)
- #define INF 10000000000
- #define mod abs
- #define pf printf
- #define sf scanf
- #define MAXX 1000 + 2
- using namespace std;
- char input[MAXX];
- int graph[MAXX];
- int len;
- struct DATA{
- int position, ampm, porishrom;
- void set(int ap, int rt)
- {
- ampm = ap;
- porishrom = rt;
- }
- };
- int bfs()
- {
- bool visited[MAXX][13][16];
- mem(visited, 0);
- DATA u, v;
- u.position = 0;
- u.set(0, 0);
- visited[0][0][0] = true;
- queue<DATA>Q;
- Q.push(u);
- while( !Q.empty() )
- {
- u = Q.front();
- if(u.position % 2 == 0)
- {//diner bela
- }
- }
- }
- int main()
- {
- int kases;
- getint(kases);
- while(kases--)
- {
- cin>>input;
- len = strlen(input) - 1;
- int it = 0;
- graph[0] = 0;
- FOR(i, 1, len)
- {
- if(input[i] == '.')
- {
- if(it % 2 == 1)
- {
- it++;
- graph[it] = 0;
- }
- graph[it]++;
- }
- else
- {
- if(it % 2 == 0)
- {
- it++;
- graph[it] = 0;
- }
- graph[it]++;
- }
- }
- len = it;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement