Submission #19445533


Source Code Expand

Copy
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using namespace std;
using ll = long long;
using P = pair<int, int>;
using mint = modint;
#define endl "\n"
#define all(v) v.begin(), v.end()
#define rep(i, begin, end) for(int i = begin; i < (int)(end); i++)
#define contains(v, x) (find(all(v), x) != v.end())
struct Edge{ int to; ll cost; Edge(int to, ll cost) : to(to), cost(cost) {} };
using Graph = vector<vector<ll>>;
template<class T> bool chmin(T& a, T b){ if (a > b){ a = b; return true; } return false; }
template<class T> bool chmax(T& a, T b){ if (a < b){ a = b; return true; } return false; }
template<class T> T roundup(T a, T b){ return (a + b - 1) / b; }
const ll MOD = (ll)1e9 + 7;
const ll INF = (ll)1e9;
const double PI = 3.14159265359;
const vector<int> dy = {1, 0, -1, 0, 1, 1, -1, -1, 0};
const vector<int> dx = {0, 1, 0, -1, 1, -1, 1, -1, 0};

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    mint::set_mod(MOD);
    
    string a;
    int b;
    cin >> a >> b;
    
    b--;
    b %= a.size();
    cout << a[b] << endl;
}

Submission Info

Submission Time
Task B - とても長い文字列
User zuzuzuzu4z
Language C++ (GCC 9.2.1)
Score 100
Code Size 1126 Byte
Status AC
Exec Time 10 ms
Memory 3648 KB

Judge Result

Set Name sub All
Score / Max Score 30 / 30 70 / 70
Status
AC × 12
AC × 24
Set Name Test Cases
sub test_01A.txt, test_02A.txt, test_04A.txt, test_05A.txt, test_07A.txt, test_09A.txt, test_11A.txt, test_13A.txt, test_14A.txt, test_15A.txt, test_17A.txt, test_18A.txt
All sample_01.txt, sample_02.txt, sample_03.txt, test_01A.txt, test_02A.txt, test_03.txt, test_04A.txt, test_05A.txt, test_06.txt, test_07A.txt, test_08.txt, test_09A.txt, test_10.txt, test_11A.txt, test_12.txt, test_13A.txt, test_14A.txt, test_15A.txt, test_16.txt, test_17A.txt, test_18A.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
sample_01.txt AC 10 ms 3496 KB
sample_02.txt AC 2 ms 3496 KB
sample_03.txt AC 2 ms 3632 KB
test_01A.txt AC 2 ms 3636 KB
test_02A.txt AC 2 ms 3464 KB
test_03.txt AC 2 ms 3568 KB
test_04A.txt AC 2 ms 3564 KB
test_05A.txt AC 2 ms 3628 KB
test_06.txt AC 2 ms 3420 KB
test_07A.txt AC 2 ms 3552 KB
test_08.txt AC 3 ms 3648 KB
test_09A.txt AC 2 ms 3476 KB
test_10.txt AC 2 ms 3500 KB
test_11A.txt AC 2 ms 3632 KB
test_12.txt AC 2 ms 3632 KB
test_13A.txt AC 2 ms 3624 KB
test_14A.txt AC 2 ms 3472 KB
test_15A.txt AC 2 ms 3624 KB
test_16.txt AC 2 ms 3620 KB
test_17A.txt AC 2 ms 3416 KB
test_18A.txt AC 2 ms 3420 KB