AtCoder Regular Contest 022

Submission #1005227

Source codeソースコード

#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
template<class T> using vv=vector<vector< T > >;

void no() {
  printf("NO\n");
}

void yes() {
  printf("YES\n");
}

int main() {
  string s;
  cin >> s;
  int len = s.length();
  int ii, ci, ti;
  ii = ci = ti = -1;
  rep (i, len) {
    if (s[i] == 'I' || s[i] == 'i') {
      ii = i;
      break;
    }
  }
  if (ii < 0) {
    no();
    return 0;
  }
  FOR (i, ii+1, len) {
    if (s[i] == 'C' || s[i] == 'c') {
      ci = i;
      break;
    }
  }
  if (ci < 0) {
    no();
    return 0;
  }
  FOR (i, ci+1, len) {
    if (s[i] == 'T' || s[i] == 't') {
      yes();
      return 0;
    }
  }
  no();

  return 0;
}

Submission

Task問題 A - スーパーICT高校生
User nameユーザ名 gosenoku
Created time投稿日時
Language言語 C++11 (GCC 4.8.1)
Status状態 AC
Score得点 100
Source lengthソースコード長 1559 Byte
File nameファイル名
Exec time実行時間 20 ms
Memory usageメモリ使用量 928 KB

Test case

Set

Set name Score得点 / Max score Cases
All 100 / 100 task01.txt,task02.txt,task03.txt,task04.txt,task05.txt,task06.txt,task07.txt,task08.txt,task09.txt,task10.txt,task11.txt,task12.txt,task13.txt,task14.txt,task15.txt,task16.txt,task17.txt,task18.txt,task19.txt,task20.txt,task21.txt,task22.txt,task23.txt,task24.txt,task25.txt,task26.txt,task27.txt,task28.txt,task29.txt,task30.txt,task31.txt,task32.txt,task33.txt,task34.txt,task35.txt,task36.txt,task37.txt,task38.txt,task39.txt,task40.txt,task41.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
sample1.txt AC 19 ms 800 KB
sample2.txt AC 17 ms 924 KB
sample3.txt AC 17 ms 800 KB
sample4.txt AC 18 ms 924 KB
sample5.txt AC 17 ms 928 KB
task01.txt AC 19 ms 800 KB
task02.txt AC 18 ms 796 KB
task03.txt AC 18 ms 800 KB
task04.txt AC 16 ms 924 KB
task05.txt AC 17 ms 800 KB
task06.txt AC 19 ms 924 KB
task07.txt AC 17 ms 924 KB
task08.txt AC 17 ms 924 KB
task09.txt AC 18 ms 924 KB
task10.txt AC 17 ms 800 KB
task11.txt AC 18 ms 800 KB
task12.txt AC 18 ms 840 KB
task13.txt AC 19 ms 792 KB
task14.txt AC 18 ms 800 KB
task15.txt AC 19 ms 916 KB
task16.txt AC 19 ms 800 KB
task17.txt AC 18 ms 920 KB
task18.txt AC 17 ms 800 KB
task19.txt AC 20 ms 752 KB
task20.txt AC 19 ms 924 KB
task21.txt AC 19 ms 924 KB
task22.txt AC 19 ms 920 KB
task23.txt AC 18 ms 800 KB
task24.txt AC 18 ms 796 KB
task25.txt AC 17 ms 672 KB
task26.txt AC 17 ms 672 KB
task27.txt AC 17 ms 792 KB
task28.txt AC 19 ms 716 KB
task29.txt AC 17 ms 800 KB
task30.txt AC 17 ms 800 KB
task31.txt AC 19 ms 796 KB
task32.txt AC 16 ms 796 KB
task33.txt AC 17 ms 924 KB
task34.txt AC 19 ms 796 KB
task35.txt AC 19 ms 672 KB
task36.txt AC 18 ms 924 KB
task37.txt AC 18 ms 800 KB
task38.txt AC 18 ms 672 KB
task39.txt AC 19 ms 796 KB
task40.txt AC 18 ms 912 KB
task41.txt AC 18 ms 924 KB