結果

問題 No.2460 #強調#
ユーザー rankturniprankturnip
提出日時 2023-09-08 22:07:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,622 bytes
コンパイル時間 1,820 ms
コンパイル使用メモリ 169,468 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 22:07:14
合計ジャッジ時間 2,629 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = 1; i <= (int)(n); i++)
//素数判定
bool is_prime(const unsigned n) {
    switch (n) {
    case 0: // fall-through
    case 1: return false;
    } // n > 1 が保証された
 
    // n より小さい数で n を割って余りを調べる
    // 素数ならば自分より小さい数(1以外)では割り切れない
    for (unsigned i = 2; i * i <= n; ++i) {
        if (n % i == 0) return false;
    }
 
    return true;
}
//mod mでaの逆元を計算.
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
//素因数分解(O(√N)).
vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数
 
        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
 
        // その結果を push
        res.push_back({ a, ex });
    }
 
    // 最後に残った数について
    if (N != 1) res.push_back({ N, 1 });
    return res;
}
int main(){
	string s;
	cin>>s;
	int a=-1,b=-1;
	int n=s.size();
	rep(i,n){
		if (s[i]=='#' && a==-1){
			a=i;
			rep(j,n){
				if (i!=j and s[j]=='#') b=j;
			}
		}
	}
	for(int i=a+1;i<=b-1;i++) cout<<s[i];
}
0