提出 #3793765


ソースコード 拡げる

#include<bits/stdc++.h>
#define intt long long 
using namespace std;
char s[1000000];
intt num,ans,id;
int main(){	
	scanf("%s",s+1);
	int n=strlen(s+1);
	id=n;
	for(int i=n;i;i--)
		if(s[i]=='B')ans+=id-i,id--;
	cout<<ans<<endl;
	return 0;
}

提出情報

提出日時
問題 A - Irreversible operation
ユーザ Lce
言語 C++14 (GCC 5.4.1)
得点 300
コード長 255 Byte
結果 AC
実行時間 3 ms
メモリ 384 KiB

コンパイルエラー

./Main.cpp: In function ‘int main()’:
./Main.cpp:7:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s",s+1);
                 ^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 2
AC × 14
セット名 テストケース
Sample sample01.txt, sample02.txt
All sample01.txt, sample02.txt, in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, sample01.txt, sample02.txt
ケース名 結果 実行時間 メモリ
in01.txt AC 3 ms 384 KiB
in02.txt AC 3 ms 384 KiB
in03.txt AC 3 ms 384 KiB
in04.txt AC 3 ms 384 KiB
in05.txt AC 3 ms 384 KiB
in06.txt AC 2 ms 384 KiB
in07.txt AC 2 ms 384 KiB
in08.txt AC 2 ms 384 KiB
in09.txt AC 2 ms 384 KiB
in10.txt AC 2 ms 384 KiB
sample01.txt AC 1 ms 256 KiB
sample02.txt AC 1 ms 256 KiB