/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 360.0 KiB
#2 Wrong Answer 6ms 744.0 KiB
#3 Wrong Answer 2ms 440.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        string str;
        cin >> str;
        vector<char> v;
        for (int i = 1; i < n; i++)
        {
            if (str[i] == '1')
            {
                v.push_back(str[i]);
            }
        }
        cout << v.size() << endl;
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1016 Swap sort
Contest
Brain booster - 1
Language
C++20 (G++ 13.2.0)
Submit At
2023-12-31 14:27:06
Judged At
2024-11-11 03:46:16
Judged By
Score
20
Total Time
6ms
Peak Memory
744.0 KiB