Contest Duration: ~ (local time) (100 minutes) Back to Home

Submission #3154011

Source Code Expand

Copy
```#include <iostream>
#include <vector>
#include <utility>
#include <numeric>
#include <functional>
#include <stdio.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <deque>
#include <queue>
#include <map>

#define rep(i, m, n) for (int (i)(m); (i)<(n); ++(i))
#define repr(i, m, n) for (int (i)(m - 1); (i)>=(n); --(i))
#define repv(i, v) for (unsigned (i)(0); (i)<(v.size()); ++(i))
#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define sortgi(v) sort(all(v), greater<int>())
#define sortgd(v) sort(all(v), greater<double>())
#define sortgll(v) sort(all(v), greater<ll>())
#define debug(x) cerr << #x << ": " << x << '\n'

using namespace std;
using pii = pair<int, int>;
using pss = pair<string, string>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using ll = long long;
using pllll = pair<ll, ll>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vpii = vector<pii>;
using pqi = priority_queue<int>;
using pqd = priority_queue<double>;
using pqll = priority_queue<ll>;
using pqvi = priority_queue<vi>;
using pqvll = priority_queue<vll>;

int main() {
int n;
cin >> n;
vs w;
rep(i, 0, n) {
string s;
cin >> s;
w.push_back(s);
}
string s0(w[0]);
repv(i, w) {
repv(j, w) {
if (w[i] == w[j] && i != j) {
cout << "No" << endl;
return 0;
}
}
}
rep(i, 1, n) {
string s1 = w[i];
if (s0[s0.size() - 1] != s1[0]) {
cout << "No" << endl;
return 0;
}
s0 = s1;
}
cout << "Yes" << endl;
}
```

#### Submission Info

Submission Time 2018-09-08 21:10:37+0900 B - Shiritori taku0728 Python (3.4.3) 0 1731 Byte RE 17 ms 2940 KB

#### Judge Result

Set Name Score / Max Score Test Cases
All 0 / 200 max_1, max_2, max_3, max_4, min_1, no1_1, no1_2, no2_1, no2_2, random_1, random_2, sample_01, sample_02, sample_03, sample_04, yes_1, yes_2
Sample 0 / 0 sample_01, sample_02, sample_03, sample_04
Case Name Status Exec Time Memory
max_1 16 ms 2940 KB
max_2 16 ms 2940 KB
max_3 16 ms 2940 KB
max_4 16 ms 2940 KB
min_1 16 ms 2940 KB
no1_1 16 ms 2940 KB
no1_2 16 ms 2940 KB
no2_1 16 ms 2940 KB
no2_2 17 ms 2940 KB
random_1 16 ms 2940 KB
random_2 16 ms 2940 KB
sample_01 16 ms 2940 KB
sample_02 16 ms 2940 KB
sample_03 16 ms 2940 KB
sample_04 16 ms 2940 KB
yes_1 16 ms 2940 KB
yes_2 16 ms 2940 KB