QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#407606#1366. Exam ManipulationTheSleepyDevil#WA 1ms3748kbC++141.8kb2024-05-09 05:59:152024-05-09 05:59:17

Judging History

你现在查看的是最新测评结果

  • [2024-05-09 05:59:17]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3748kb
  • [2024-05-09 05:59:15]
  • 提交

answer

    /*
     Hell, 'til I reach Hell, I ain't scared
     Mama checkin' in my bedroom, I ain't there
                                                */
    #include<bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>
    using namespace __gnu_pbds;
    using namespace std;

    #define Major  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define TxtIO   freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    #define read(a,n) for(int i = 0 ; i<n ; i++) cin>>a[i];
    #define write(a) for(auto x : a) cout<<x<<" ";
    #define int long long
    #define pb push_back
    #define all(a)  a.begin(),a.end()
    #define el "\n"

    typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

    const int inf=4e18;

    int dx[]={1,0,-1,0,1,1,-1,-1};
    int dy[]={0,1,0,-1,1,-1,1,-1};

    const int mod=1e9+7;
    const int MAX =1e6+7;

    //---------------------------Function----------------------------------//
    void TestCake(){
        int n,m;
        cin>>n>>m;
        set<int>st;
        st.insert(m);
        for(int i=0;i<n;i++){
            string s;cin>>s;
            int cnt=0;
            for(int z=0;z<s.size();z++){
                if(s[z]=='T')cnt++;
            }
            st.insert(cnt);
        }
        if(st.size()==1){
            cout<<m<<el;return;
        }
        st.erase(st.begin());
        cout<<*st.begin();
    }
    //------------------------------Main---------------------------//
    signed main(){
        Major
        int T = 1;
//        cin >> T;
        while(T--){
            TestCake();
        //       cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
        }
        return 0;
    }

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3560kb

input:

1 1
T

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3748kb

input:

1 10
TFTFTFTFTF

output:

10

result:

ok single line: '10'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3748kb

input:

1000 10
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTFTFTF
TFTFTF...

output:

10

result:

ok single line: '10'

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3564kb

input:

1000 10
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTFTFTF
FTFTFTFTFT
TFTFTF...

output:

10

result:

wrong answer 1st lines differ - expected: '5', found: '10'