Submission #67707918
Source Code Expand
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define endl '\n'
#define pb push_back
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int ll
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ii = pair<int,int>;
using iii = tuple<int,int,int>;
const int inf = 2e9+1;
const int mod = 1e9+7;
const int maxn = 3e5+100;
template<typename X, typename Y> bool ckmin(X& x, const Y& y) { return (y < x) ? (x=y,1):0; }
template<typename X, typename Y> bool ckmax(X& x, const Y& y) { return (x < y) ? (x=y,1):0; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l, int r) {
uniform_int_distribution<int> uid(l, r);
return uid(rng);
}
void solve() {
string s; cin >> s;
int n = sz(s);
int a = -1, b = -1;
for (int i = 0; i < n; ++i) {
if (s[i] == '#') {
if (a == -1) a = i+1;
else {
b = i+1;
cout << a << "," << b << endl;
a = b = -1;
}
}
}
}
int32_t main() {_
#ifndef gato
int t = 1; //cin >> t;
while(t--) solve();
#else
int t = 1;
while (true) {
int my = solve(), ans = brute();
if (my != ans) {
cout << "Wrong answer on test " << t << endl;
cout << "Your output: " << my << endl;
cout << "Answer: " << ans << endl;
exit(0);
}
cout << "Accepted on test " << t++ << endl;
}
#endif
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Pick Two |
| User | perchuts |
| Language | C++ 20 (gcc 12.2) |
| Score | 200 |
| Code Size | 1610 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3604 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt |
| All | sample_01.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| sample_01.txt | AC | 1 ms | 3464 KiB |
| test_01.txt | AC | 1 ms | 3464 KiB |
| test_02.txt | AC | 1 ms | 3520 KiB |
| test_03.txt | AC | 1 ms | 3600 KiB |
| test_04.txt | AC | 1 ms | 3512 KiB |
| test_05.txt | AC | 1 ms | 3420 KiB |
| test_06.txt | AC | 1 ms | 3460 KiB |
| test_07.txt | AC | 1 ms | 3532 KiB |
| test_08.txt | AC | 1 ms | 3416 KiB |
| test_09.txt | AC | 1 ms | 3452 KiB |
| test_10.txt | AC | 1 ms | 3604 KiB |
| test_11.txt | AC | 1 ms | 3452 KiB |
| test_12.txt | AC | 1 ms | 3468 KiB |
| test_13.txt | AC | 1 ms | 3604 KiB |
| test_14.txt | AC | 1 ms | 3328 KiB |
| test_15.txt | AC | 1 ms | 3484 KiB |
| test_16.txt | AC | 1 ms | 3524 KiB |
| test_17.txt | AC | 1 ms | 3464 KiB |
| test_18.txt | AC | 1 ms | 3456 KiB |
| test_19.txt | AC | 1 ms | 3484 KiB |
| test_20.txt | AC | 1 ms | 3468 KiB |
| test_21.txt | AC | 1 ms | 3452 KiB |
| test_22.txt | AC | 1 ms | 3532 KiB |
| test_23.txt | AC | 1 ms | 3388 KiB |
| test_24.txt | AC | 1 ms | 3464 KiB |