QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394655#1371. Missing NumberKareemEssam#WA 0ms3616kbC++201.7kb2024-04-20 17:14:462024-04-20 17:14:47

Judging History

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

  • [2024-04-20 17:14:47]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3616kb
  • [2024-04-20 17:14:46]
  • 提交

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 , skip = 0;
    cin >> n;
    string s , curTurn = "1";
    cin >> s;
    for(int i = 0 ; i < s.size() ; i++){
        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 << curTurn , void();
            }else
                return cout << curTurn , 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 << curTurn , void();
            }else
                return cout << curTurn , void();
        }
        ll tmp = stol(curTurn);
        tmp++;
        curTurn = to_string(tmp);
    }
}

signed main() {

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

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3616kb

input:

2
1

output:


result:

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