QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#358242#407. Toiletsmkolko0 1ms3528kbC++171.3kb2024-03-19 18:23:432024-03-19 18:23:44

Judging History

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

  • [2024-03-19 18:23:44]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3528kb
  • [2024-03-19 18:23:43]
  • 提交

answer

#include <iostream>
#include <vector>
using namespace std;

int dane[100'007];
vector<int> tab;

int fun(int n, vector<int> in)
{
    int kob=in.size()-1, koe=in.size()-1;
    for(int a=0; a<n; a++)
    {
        while(in[kob]==-1 || in[kob]==0)
            kob--;
        if(in[kob]==-69)
            return 0;
        in[kob]=-1;
        //cout<<kob<<" ";

        while(in[koe]==-1)
            koe--;
        if(in[koe]==-69)
            return 0;
        in[koe]=-1;
        //cout<<koe<<"\n";
    }
    return 1;
}

int main()
{
    string s;
    int n, m, p, odp=0, suma=0;
    cin>>n>>m>>s>>p;
    for(int a=0; a<n*2; a++)
    {
        if(s[a]=='F'){
            suma++;
            dane[a]=1;
        }
    }
    for(int a=20; a>=0; a--)
    {
        tab.clear();
        tab.push_back(-69);
        for(int i=0; i<n*2; i++)
        {
            if(dane[i]==1 || tab.size() >=i-2-odp-(1<<a))
                tab.push_back(dane[i]);
        }
        for(int i=tab.size()-1; i<n*2; i++)
            tab.push_back(0);
        for(int i=0; i<tab.size(); i++)
            cout<<tab[i]<<" ";
        cout<<endl;
        cout<<fun(n,tab)<<" "<<odp<<" "<<(1<<a)<<"|\n";
        if(fun(n,tab)==0)
            odp=odp+(1<<a);
    }
    cout<<odp;
    return 0;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3528kb

input:

10
1
FMFFFFFFMFFFMMMMMFMM 1

output:

-69 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 
1 0 1048576|
-69 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 
1 0 524288|
-69 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 
1 0 262144|
-69 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 
1 0 131072|
-69 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 
1 0 65536|
-69 1 1 1 1 1 1...

result:

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

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #1:

0%