Submission #3235716


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;

// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

int main() {

    char s[100000];

    Scs(s);


    ll ans = strlen(s) * (strlen(s) - 1);
    Rep(i,(strlen(s))){
        if( s[i] == 'U' ){
            ans += i;
        }else{
            ans += strlen(s) - 1 - i;
        }
    }

    printf ("%llu\n", ans);


    return 0;
}

Submission Info

Submission Time
Task B - Evilator
User nishionyama
Language C++14 (GCC 5.4.1)
Score 400
Code Size 1116 Byte
Status AC
Exec Time 2 ms
Memory 384 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:17:30: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 #define Scs(s) scanf("%s", s);
                              ^
./Main.cpp:42:5: note: in expansion of macro ‘Scs’
     Scs(s);
     ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 2
AC × 12
Set Name Test Cases
Sample s1.txt, s2.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, s1.txt, s2.txt
Case Name Status Exec Time Memory
01.txt AC 2 ms 384 KB
02.txt AC 2 ms 384 KB
03.txt AC 2 ms 384 KB
04.txt AC 2 ms 384 KB
05.txt AC 1 ms 384 KB
06.txt AC 1 ms 384 KB
07.txt AC 1 ms 384 KB
08.txt AC 2 ms 384 KB
09.txt AC 1 ms 256 KB
10.txt AC 1 ms 256 KB
s1.txt AC 1 ms 256 KB
s2.txt AC 1 ms 256 KB