AtCoder Regular Contest 014

Submission #1072759

Source codeソースコード

#include <algorithm>
#include <cassert>
#include <cfloat>
#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 > >;

int main() {
  int n;
  cin >> n;
  set<string> sets;
  string prev, current;
  cin >> prev;
  sets.insert(prev);
  FOR (i, 1, n) {
    cin >> current;
    if (sets.find(current) != end(sets) || prev[(int)prev.length() -  1] != current[0]) {
      if ((i & 1) == 1) {
        printf("WIN\n");
      } else {
        printf("LOSE\n");
      }
      return 0;
    }
    sets.insert(current);
    prev = current;
  }
  printf("DRAW\n");

  return 0;
}

Submission

Task問題 B - あの日したしりとりの結果を僕達はまだ知らない。
User nameユーザ名 mu
Created time投稿日時
Language言語 C++11 (GCC 4.8.1)
Status状態 AC
Score得点 100
Source lengthソースコード長 1438 Byte
File nameファイル名
Exec time実行時間 19 ms
Memory usageメモリ使用量 928 KB

Test case

Set

Set name Score得点 / Max score Cases
All 100 / 100 00_sample_01.txt,00_sample_02.txt,01_freeword_01.txt,01_freeword_02.txt,01_freeword_03.txt,01_min.txt,02_randomwords_00.txt,02_randomwords_01.txt,02_randomwords_02.txt,02_randomwords_03.txt,02_randomwords_04.txt,02_randomwords_05.txt,02_randomwords_06.txt,02_randomwords_07.txt,02_randomwords_08.txt,02_randomwords_09.txt,03_randomconnectwords_00.txt,03_randomconnectwords_01.txt,03_randomconnectwords_02.txt,03_randomconnectwords_03.txt,03_randomconnectwords_04.txt,03_randomconnectwords_05.txt,03_randomconnectwords_06.txt,03_randomconnectwords_07.txt,03_randomconnectwords_08.txt,03_randomconnectwords_09.txt,04_veryshort_00.txt,04_veryshort_01.txt,04_veryshort_02.txt,04_veryshort_03.txt,04_veryshort_04.txt,04_veryshort_05.txt,04_veryshort_06.txt,04_veryshort_07.txt,04_veryshort_08.txt,04_veryshort_09.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
00_sample_01.txt AC 18 ms 676 KB
00_sample_02.txt AC 17 ms 800 KB
01_freeword_01.txt AC 17 ms 800 KB
01_freeword_02.txt AC 18 ms 804 KB
01_freeword_03.txt AC 18 ms 928 KB
01_min.txt AC 18 ms 804 KB
02_randomwords_00.txt AC 18 ms 796 KB
02_randomwords_01.txt AC 18 ms 796 KB
02_randomwords_02.txt AC 17 ms 800 KB
02_randomwords_03.txt AC 18 ms 800 KB
02_randomwords_04.txt AC 18 ms 800 KB
02_randomwords_05.txt AC 18 ms 800 KB
02_randomwords_06.txt AC 18 ms 676 KB
02_randomwords_07.txt AC 18 ms 804 KB
02_randomwords_08.txt AC 18 ms 800 KB
02_randomwords_09.txt AC 16 ms 800 KB
03_randomconnectwords_00.txt AC 17 ms 676 KB
03_randomconnectwords_01.txt AC 17 ms 800 KB
03_randomconnectwords_02.txt AC 18 ms 804 KB
03_randomconnectwords_03.txt AC 16 ms 848 KB
03_randomconnectwords_04.txt AC 16 ms 804 KB
03_randomconnectwords_05.txt AC 19 ms 804 KB
03_randomconnectwords_06.txt AC 18 ms 800 KB
03_randomconnectwords_07.txt AC 18 ms 800 KB
03_randomconnectwords_08.txt AC 18 ms 800 KB
03_randomconnectwords_09.txt AC 18 ms 804 KB
04_veryshort_00.txt AC 18 ms 800 KB
04_veryshort_01.txt AC 17 ms 920 KB
04_veryshort_02.txt AC 18 ms 676 KB
04_veryshort_03.txt AC 18 ms 804 KB
04_veryshort_04.txt AC 18 ms 676 KB
04_veryshort_05.txt AC 18 ms 804 KB
04_veryshort_06.txt AC 18 ms 928 KB
04_veryshort_07.txt AC 18 ms 804 KB
04_veryshort_08.txt AC 16 ms 676 KB
04_veryshort_09.txt AC 18 ms 848 KB