QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#394630 | #1371. Missing Number | Zuqa# | RE | 0ms | 0kb | C++20 | 1.6kb | 2024-04-20 17:02:29 | 2024-04-20 17:02:30 |
answer
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define el '\n'
#define FIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned uint;
typedef __int128 bint;
typedef long double ld;
typedef complex<ld> pt;
typedef unsigned long long ull;
template<typename T, typename X>
using hashTable = gp_hash_table<T, X>;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
// mt19937_64 for unsigned long long
mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());
const int mod = 998244353, N = 1e5 + 5;
void doWork()
{
int n;
cin >> n;
int num = 1;
string str;
cin >> str;
reverse(str.begin(), str.end());
while(!str.empty())
{
string t = to_string(num);
string s = "";
if((int) str.size() < (int) t.size())
{
cout << num << '\n';
return;
}
while((int) s.size() < (int) t.size())
{
s += str.back();
str.pop_back();
}
if(s != t)
{
cout << num << '\n';
return;
}
num += 1;
}
assert(false);
}
signed main()
{
FIO
int T = 1;
// cin >> T;
for(int i = 1; i <= T; i++)
doWork();
}
詳細信息
Test #1:
score: 0
Runtime Error
input:
2 1