Submission #432312


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)
#define loop for(;;)
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;
#define inf (1e9)
#define eps (1e-9)
using Integer = long long;
using Real = long double;
const Real PI = acos(-1);

template<class S, class T> inline
ostream& operator<<(ostream&os, pair<S,T> p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template<class S, class T, class U> inline
ostream& operator<<(ostream&os, tuple<S,T,U> t) {
  return os << '('
    << get<0>(t) << ", "
    << get<1>(t) << ", "
    << get<2>(t) << ')';
}

template<class T> inline
ostream& operator<<(ostream&os, vector<T> v) {
  if (v.size() == 0) { return os << "(empty)"; }
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

template<class T> inline
istream& operator>>(istream&is, vector<T>&v) {
  rep (i, v.size()) is >> v[i];
  return is;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

using vi = vector<int>;
using vvi = vector<vi>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout.setf(ios::fixed);
  cout.precision(10);
  random_device dev;
  mt19937 rand(dev());

  string s; cin >> s;
  set<pair<char, char>> a;

  rep (i, 5)
    rep (j, 5)
    a.insert({ s[i], s[j] });

  int n; cin >> n;
  --n;

  int i = 0;
  for (auto&p: a) {
    if (i == n) {
      cout << p.first << p.second << endl;
    }
    ++i;
  }


  return 0;
}

Submission Info

Submission Time
Task A - 25個の文字列
User cympfh
Language C++ (GCC 4.9.2)
Score 0
Code Size 1536 Byte
Status CE

Compile Error

./Main.cpp:9:7: error: expected nested-name-specifier before ‘Integer’
 using Integer = long long;
       ^
./Main.cpp:10:7: error: expected nested-name-specifier before ‘Real’
 using Real = long double;
       ^
./Main.cpp:11:7: error: ‘Real’ does not name a type
 const Real PI = acos(-1);
       ^
./Main.cpp:19:33: error: ‘tuple’ has not been declared
 ostream& operator<<(ostream&os, tuple<S,T,U> t) {
                                 ^
./Main.cpp:19:38: error: expected ‘,’ or ‘...’ before ‘<’ token
 ostream& operator<<(ostream&os, tuple<S,T,U> t) {
                                      ^
./Main.cpp: In function ‘std::ostream& operator<<(std::ostream&, int)’:
./Main.cpp:21:8: error: ‘get’ was not declared in this scope
     << get<0>(t) << ", "
        ^
./Main.cpp:21:15: error: ‘t’ was not declared in this scope
     << get<0>(t) << ", "
               ^
./Main.cpp: At global scope:
./Main.cpp:43:7: error: expected nested-name-specifier before ‘vi’
 using v...