Submission #1515151


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
ll gcd(ll a,ll b){while(b){ll tmp = a % b;a = b;b = tmp;}return a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
#define rep(x, y) for(int x = 0; x < (y); x++)
#define REP(x, z, y) for(int x = (z); x < (y); x++)
#define all(x) x.begin(), x.end()
#define split_str(str, sp_word) istringstream stream(str); string res; for(int cnt = 0; getline(stream,res,sp_word); cnt++)
#define down_queue(x) priority_queue<x>
#define up_queue(x) priority_queue<x, vector<x>, greater<x>>
#define digit(x) ((int)log10((double)(x)) + 1)
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define outs(x) for(auto i : x) cout << i << " "; cout << endl;
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define MOD = 1000000007; 
#define DEBUG false
 
int main(){ 
  str s; cin >> s;
  int w = 0;
  string tile = "WBWBWWBWBWBW";

  rep(i,s.length()){
    if(s[i] == 'W') w++; 
    if(s.substr(i,12) == tile or w == 7) break;
  }
  string tone[] = {"Do","Si","La","So","Fa","Mi","Re"};
  cout << tone[w - 1];
  return 0;
}

Submission Info

Submission Time
Task C - ピアニスト高橋君
User uehara_37
Language C++14 (GCC 5.4.1)
Score 100
Code Size 1152 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 1
AC × 8
Set Name Test Cases
Sample example_0.txt
All example_0.txt, handmade_0.txt, handmade_1.txt, handmade_2.txt, handmade_3.txt, handmade_4.txt, handmade_5.txt, handmade_6.txt
Case Name Status Exec Time Memory
example_0.txt AC 1 ms 256 KB
handmade_0.txt AC 1 ms 256 KB
handmade_1.txt AC 1 ms 256 KB
handmade_2.txt AC 1 ms 256 KB
handmade_3.txt AC 1 ms 256 KB
handmade_4.txt AC 1 ms 256 KB
handmade_5.txt AC 1 ms 256 KB
handmade_6.txt AC 1 ms 256 KB