結果

問題 No.932 解法破綻!高橋君
ユーザー LV3zJigVW57oPGyLV3zJigVW57oPGy
提出日時 2022-11-19 12:14:24
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 605 bytes
コンパイル時間 1,326 ms
コンパイル使用メモリ 162,736 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 17:31:00
合計ジャッジ時間 2,369 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:15:20: warning: ‘abcd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   15 |     int fi = a.find(",",abcd);
      |              ~~~~~~^~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <algorithm>
 
int main(){
  
  string a;
  cin >> a;
  string b;
  int muri = 0;
  int count1 = 0;
  int abcd;
  int cou = count(a.begin(),a.end(),',');
  for(int i=1;i<=cou ;i++){
    int fi = a.find(",",abcd);
   	if(i==1)b = a.substr(0,fi);
    else b = a.substr(count1,fi);
    count1 += b.size()+1;
    cout << b << endl << fi << endl;
    if(b!="AC"){
      muri++;
      break;
    }
    if(i==cou){
      if(a.substr(count1)!="AC") muri++;
    }
    abcd = fi;
  }
  if (muri==0)cout << "Done!";
  else cout << "Failed..."; 
  cout << muri;
}
0