QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394662#1371. Missing NumberKareemEssam#WA 1ms3852kbC++201.7kb2024-04-20 17:20:382024-04-20 17:20:38

Judging History

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

  • [2024-04-20 17:20:38]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3852kb
  • [2024-04-20 17:20:38]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
template<typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long double ld;


#define lmao ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll N =  1e5 + 5 , M = 1e4+5 , MOD = 1e9 + 7, LOG = 20 , Msk = 21 , pw1 = 31 , pwe2 = 37 ;


void testCase() {
    int n;
    cin >> n;
    string s , curTurn = "1";
    cin >> s;
    for(int i = 0 ; i < s.size() ; i++){
        ll cur = stol(curTurn);
        if(curTurn.size() == 1){
            if(s[i] != curTurn[0])
                return cout << curTurn , void();
        }else if(curTurn.size() == 2){
            if(i + 1 < s.size()){
                if(s[i] == curTurn[0] && s[i + 1] == curTurn[1])
                    i++;
                else
                    return cout << cur , void();
            }else
                return cout << cur , void();
        }else if(curTurn.size() == 3){
            if(i + 2 < s.size()){
                if(s[i] == curTurn[0] && s[i + 1] == curTurn[1] && s[i + 2] == curTurn[2])
                    i+=2;
                else
                    return cout <<   cur , void();
            }else
                return cout << cur , void();
        }
        ll tmp = stol(curTurn);
        tmp++;
        curTurn = to_string(tmp);
    }
}

signed main() {

    lmao
    int t = 1;
//    cin >> t;
    while (t--)
        testCase();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
1

output:


result:

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