提出 #58668294


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define all(vec) vec.begin(), vec.end()
#define repr(i,from,to) for (ll i=from; i<to; ++i)
#define rep(i,N) repr(i,0,N)
#define per(i,N) for(ll i=N-1; i>=0; --i)
template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }

const ll INF = (1ll<<61)-1;
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }

// --------------------------------------------
// mod
// --------------------------------------------
const ll MOD = 998244353;
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { int d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll mpow(ll n, ll p, ll m=MOD) { ll result = 1; for (ll i=1; i<=p; i=i<<1) { if (p&i) result = result*n%m; n = n*n%m; } return result; }
ll madd(ll x, ll y, ll m=MOD) { return (x+y)%m; }
ll msub(ll x, ll y, ll m=MOD) { return (x-y+m)%m; }
ll mmul(ll x, ll y, ll m=MOD) { return x*y%m; }
ll mdiv(ll x, ll y, ll m=MOD) { return mmul(x, inv(y)); }

vector<ll> fac;
void c_fac(int x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll nck(ll n, ll k) { return mdiv(fac[n], mmul(fac[k],fac[n-k])); }


int main() {
  ll N; cin >> N;
  string S; cin >> S;

  ll result = 0;
  rep(i,N-2) {
    result += S[i] == '#' && S[i+1] == '.' && S[i+2] == '#';
  }
  cout << result << endl;
  return 0;
}

提出情報

提出日時
問題 A - Seats
ユーザ sak
言語 C++ 20 (gcc 12.2)
得点 100
コード長 1490 Byte
結果 AC
実行時間 4 ms
メモリ 3696 KiB

コンパイルエラー

Main.cpp: In function ‘ll mdiv(ll, ll, ll)’:
Main.cpp:24:24: warning: unused parameter ‘m’ [-Wunused-parameter]
   24 | ll mdiv(ll x, ll y, ll m=MOD) { return mmul(x, inv(y)); }
      |                     ~~~^~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 3
AC × 23
セット名 テストケース
Sample sample00.txt, sample01.txt, sample02.txt
All sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt
ケース名 結果 実行時間 メモリ
sample00.txt AC 1 ms 3544 KiB
sample01.txt AC 1 ms 3544 KiB
sample02.txt AC 1 ms 3616 KiB
testcase00.txt AC 1 ms 3464 KiB
testcase01.txt AC 1 ms 3616 KiB
testcase02.txt AC 1 ms 3604 KiB
testcase03.txt AC 1 ms 3500 KiB
testcase04.txt AC 1 ms 3464 KiB
testcase05.txt AC 1 ms 3408 KiB
testcase06.txt AC 1 ms 3536 KiB
testcase07.txt AC 1 ms 3548 KiB
testcase08.txt AC 3 ms 3544 KiB
testcase09.txt AC 3 ms 3652 KiB
testcase10.txt AC 2 ms 3600 KiB
testcase11.txt AC 3 ms 3672 KiB
testcase12.txt AC 2 ms 3660 KiB
testcase13.txt AC 3 ms 3544 KiB
testcase14.txt AC 3 ms 3604 KiB
testcase15.txt AC 3 ms 3684 KiB
testcase16.txt AC 2 ms 3696 KiB
testcase17.txt AC 4 ms 3652 KiB
testcase18.txt AC 3 ms 3600 KiB
testcase19.txt AC 4 ms 3600 KiB