Submission #22802528


Source Code Expand

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

struct Edge {
  int to;
  long long w;
  Edge(int to, long long w) : to(to), w(w) {}
};

//using Graph = vector<vector<int> >;
//using Graph = vector<vector<Edge> >;

template<class T> void chmax(T& a, T b) {
  if(a < b) a = b;
}
template<class T> void chmin(T& a, T b) {
  if(a > b) a = b;
}


struct UnionFind {
  vector<long long> par, siz;
 
  UnionFind(long long n) : par(n, -1), siz(n, 1){}
 
  long long root(long long x) {
    if(par[x] == -1) return x;
    else return par[x] = root(par[x]);
  }
 
  bool issame(long long x, long long y) {
    return root(x) == root(y);
  }
 
  bool unite(long long x, long long y) {
    x = root(x); y = root(y);
 
    if(x == y) return false;
 
    if(siz[x] < siz[y]) swap(x, y);
 
    par[y] = x;
    siz[x] += siz[y];
    return true;
  }
 
  long long size(long long x) {
    return siz[root(x)];
  }
};


int main() {
  string S;
  cin >> S;
  for(int i=S.size()-1;i>=0;i--) {
    if(S[i] == '0') cout << "0";
    if(S[i] == '1') cout << "1";
    if(S[i] == '6') cout << "9";
    if(S[i] == '8') cout << "8";
    if(S[i] == '9') cout << "6";
  }
  cout << endl;
}

Submission Info

Submission Time
Task B - 180°
User Tommy3
Language C++ (GCC 9.2.1)
Score 200
Code Size 1368 Byte
Status AC
Exec Time 14 ms
Memory 3760 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 17
Set Name Test Cases
Sample sample_00, sample_01, sample_02
All maximum_01, maximum_02, minimum_01, minimum_02, sample_00, sample_01, sample_02, test_00, test_01, test_02, test_03, test_04, test_05, test_06, test_07, test_08, test_09
Case Name Status Exec Time Memory
maximum_01 AC 14 ms 3612 KiB
maximum_02 AC 13 ms 3680 KiB
minimum_01 AC 2 ms 3420 KiB
minimum_02 AC 8 ms 3500 KiB
sample_00 AC 2 ms 3496 KiB
sample_01 AC 2 ms 3524 KiB
sample_02 AC 2 ms 3492 KiB
test_00 AC 11 ms 3724 KiB
test_01 AC 7 ms 3628 KiB
test_02 AC 5 ms 3624 KiB
test_03 AC 11 ms 3692 KiB
test_04 AC 13 ms 3760 KiB
test_05 AC 14 ms 3760 KiB
test_06 AC 4 ms 3584 KiB
test_07 AC 8 ms 3696 KiB
test_08 AC 3 ms 3608 KiB
test_09 AC 11 ms 3692 KiB