Submission #22797325


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 getb(int n) {
  if(n == 1) return 6;
  if(n == 2) return 5;
  if(n == 3) return 4;
  if(n == 4) return 3;
  if(n == 5) return 2;
  if(n == 6) return 1;
}

int main() {
  int a, b, c;
  cin >> a >> b >> c;

  cout << getb(a) + getb(b) + getb(c) << endl;

}

Submission Info

Submission Time
Task A - Three Dice
User Tommy3
Language C++ (GCC 9.2.1)
Score 100
Code Size 1371 Byte
Status AC
Exec Time 4 ms
Memory 3640 KiB

Compile Error

./Main.cpp: In function ‘int getb(int)’:
./Main.cpp:65:1: warning: control reaches end of non-void function [-Wreturn-type]
   65 | }
      | ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 12
Set Name Test Cases
Sample sample_00.txt, sample_01.txt
All sample_00.txt, sample_01.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt
Case Name Status Exec Time Memory
sample_00.txt AC 4 ms 3640 KiB
sample_01.txt AC 2 ms 3600 KiB
test_00.txt AC 4 ms 3600 KiB
test_01.txt AC 1 ms 3588 KiB
test_02.txt AC 2 ms 3452 KiB
test_03.txt AC 2 ms 3556 KiB
test_04.txt AC 2 ms 3448 KiB
test_05.txt AC 3 ms 3600 KiB
test_06.txt AC 2 ms 3400 KiB
test_07.txt AC 2 ms 3524 KiB
test_08.txt AC 2 ms 3568 KiB
test_09.txt AC 2 ms 3524 KiB