Problem p03624 (C++)

Buggy submission (status: Runtime Error):
// # define FLAG
/// delet....................................
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define eps 1e-8
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define bug puts("H");
#define mem(a, b) memset(a, b, sizeof(a))
#define IOS ios::sync_with_stdio(false);
#define FO(i, n, a) for (int i = n; i >= a; --i)
#define FOR(i, a, n) for (int i = a; i <= n; ++i)
#define MAX 0x7fffffffffffff
#define INF 0x3f3f3f3f
#define MOD 1000000007
///          1234567890
#pragma comment(linker, "/STACK:1024000000,1024000000")
typedef unsigned long long ULL;
typedef long long LL;
inline int Scan() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-')
      f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
/// coding...................................

char a[1000];
int b[27];
int main() {
  IOS
#ifdef FLAG
      freopen("in.txt", "r", stdin);
  // freopen("out.txt","w",stdout);
#endif /// FLAG
  int flag = 1;
  mem(b, -1);
  cin >> a;
  FOR(i, 0, strlen(a) - 1) b[a[i] - 'a' + 1] = 0;
  FOR(i, 1, 26) if (b[i]) {
    printf("%c\n", i + 'a' - 1);
    flag = 0;
    break;
  }
  if (flag)
    puts("None");
  return 0;
}
/// delete FLAG..............................


Fixed submission:
// # define FLAG
/// delet....................................
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define eps 1e-8
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define bug puts("H");
#define mem(a, b) memset(a, b, sizeof(a))
#define IOS ios::sync_with_stdio(false);
#define FO(i, n, a) for (int i = n; i >= a; --i)
#define FOR(i, a, n) for (int i = a; i <= n; ++i)
#define MAX 0x7fffffffffffff
#define INF 0x3f3f3f3f
#define MOD 1000000007
///          1234567890
#pragma comment(linker, "/STACK:1024000000,1024000000")
typedef unsigned long long ULL;
typedef long long LL;
inline int Scan() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-')
      f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
/// coding...................................

char a[100005];
int b[27];
int main() {
  IOS
#ifdef FLAG
      freopen("in.txt", "r", stdin);
  // freopen("out.txt","w",stdout);
#endif /// FLAG
  int flag = 1;
  mem(b, -1);
  cin >> a;
  FOR(i, 0, strlen(a) - 1) b[a[i] - 'a' + 1] = 0;
  FOR(i, 1, 26) if (b[i]) {
    printf("%c\n", i + 'a' - 1);
    flag = 0;
    break;
  }
  if (flag)
    puts("None");
  return 0;
}
/// delete FLAG..............................