hihoCoder Challenge 18 register

Ended

Participants:318

Verdict:Accepted
Submitted:2016-02-14 19:32:04

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <bits/stdc++.h>
#define INF 1000000007
#define MP make_pair
#define FI first
#define SE second
#define PB push_back
#define VI vector<int>
const double EPS = 1e-7, PI = acos(-1.0);
using namespace std;
typedef long long LL;
typedef pair <int, int> P;
const int NUM = 100010;
int solve(char a[], char b[], int n)
{
    int ans = 0;
    for(int i = 0; i < n; ++i)
    {
        if(a[i] == b[i]) continue;
        int j = i + 1;
        for(; j < n; ++j) if(a[j] == b[i]) break;
        for(; j > i; --j) ++ans, swap(a[j], a[j - 1]);
    }
    return ans;
}
char a[110], b[110], tmpa[110], tmpb[110];
int n, m, ans;
int main()
{
#ifdef ACM_TEST
    freopen("in.txt", "r", stdin);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX