/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 2ms 580.0 KiB
#3 Accepted 2ms 580.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pe(c) for (auto &e : c) cout << e << ' '; cout << '\n'
#define ps(b) cout << (b ? "YES" : "NO") << '\n'
#define pc cout << "Case " << tc << ": "
#ifdef LOCAL
#include "def.h"
#else
#define ck(...)
#endif
const ll M = 1e9 + 7, N = 2e3 + 5;
ll n, m, dp[N][N]; vector<string> ar(N);
// bool vis[N][N];
long long rec(int i, int j) {
    if(i < 0 or j < 0 or i >= n or j >= m or ar[i][j] == '1') return 0;
    auto &res = dp[i][j];
    if(~res) return res;
    // vis[i][j]=1;
    res = max({rec(i+1, j), rec(i-1, j), rec(i, j-1), rec(i, j+1)}) + 1;
    return res;
}
void test(int tc) {
	ll a = 0, b = 0, c = 0, d = 0, i = 0, j = 0, k = 0, q = 0;
// 	cin >> n >> m;
	string s; cin >> s;
	cout << s[0];
	cout << '\n';
}

signed main() {
	cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit|cin.badbit);
	int tc = 0, t = 1;
	cin >> t;
	while (tc < t) test(++tc);
	return 0;
}

Information

Submit By
Type
Submission
Problem
P1080 String Algorithm
Contest
Bangladesh 2.0
Language
C++20 (G++ 13.2.0)
Submit At
2024-08-16 15:57:09
Judged At
2024-10-03 13:29:20
Judged By
Score
100
Total Time
2ms
Peak Memory
580.0 KiB