QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#394655 | #1371. Missing Number | KareemEssam# | WA | 0ms | 3616kb | C++20 | 1.7kb | 2024-04-20 17:14:46 | 2024-04-20 17:14:47 |
Judging History
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: ''