提出 #62029408


ソースコード 拡げる

/*
           _                   _         _       __  __  _____ 
     /\   | |            /\   | |       | |     |  \/  |/ ____|
    /  \  | |__   ___   /  \  | |__   __| | ___ | \  / | |     
   / /\ \ | '_ \ / _ \ / /\ \ | '_ \ / _` |/ _ \| |\/| | |     
  / ____ \| |_) | (_) / ____ \| |_) | (_| | (_) | |  | | |____ 
 /_/    \_\_.__/ \___/_/    \_\_.__/ \__,_|\___/|_|  |_|\_____|
*/

// build command:
// g++ -std=gnu++17 -O3 -DDEBUG -g -fsanitize=signed-integer-overflow -fsanitize=bounds-strict -fsanitize=address -fsanitize=integer-divide-by-zero -fsanitize=float-divide-by-zero -fsanitize=pointer-overflow -fsanitize=shift-exponent -fsplit-stack -Wshadow -Wall -fconcepts -Wno-unused-result

// REMEMBER:
// BS, Offline, Persistent SegTree, SQRT, Treap, MaxFlow, FFT, Matrices

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

#pragma GCC optimize("O3,unroll-loops")

// DEBUG STUFF
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }
void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
#ifdef DEBUG
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif


#define F first
#define S second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

// RANDOM NUMBER GENERATOR
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count());  
#define SHUF(v) shuffle(all(v), RNG); 
// Use mt19937_64 for 64 bit random numbers.

int getrand(int l,int r) {
	return uniform_int_distribution<int>(l, r)(RNG);
}

const ld eps = 1e-9;
const int mod = 1e9 + 7;
const int oo = 1e9 + 7;
const ll lloo = 1e18 + 7;
const int N = 1e6 + 7;

void solve(int tc) {
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0 ; i < n ; i++) cin >> a[i];
	
	for(int i = 1 ; i < n-1 ; i++) {
		if ((ll)a[i]*a[i] != (ll)a[i-1]*a[i+1]) {
			cout << "No\n";
			return;
		}
	}
	cout << "Yes\n";
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	// freopen("in","r",stdin);
	// freopen("out","w",stdout);
	int T = 1;
	//cin >> T;
	for(int i = 0 ; i < T ; i++) solve(i+1);
	return 0;
}

提出情報

提出日時
問題 B - Geometric Sequence
ユーザ b4n4n4s
言語 C++ 20 (gcc 12.2)
得点 200
コード長 2728 Byte
結果 AC
実行時間 1 ms
メモリ 3608 KiB

コンパイルエラー

Main.cpp: In function ‘void solve(int)’:
Main.cpp:59:16: warning: unused parameter ‘tc’ [-Wunused-parameter]
   59 | void solve(int tc) {
      |            ~~~~^~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 30
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 1 ms 3320 KiB
example_01.txt AC 1 ms 3600 KiB
example_02.txt AC 1 ms 3468 KiB
hand_00.txt AC 1 ms 3608 KiB
hand_01.txt AC 1 ms 3472 KiB
hand_02.txt AC 1 ms 3476 KiB
hand_03.txt AC 1 ms 3600 KiB
hand_04.txt AC 1 ms 3476 KiB
hand_05.txt AC 1 ms 3476 KiB
hand_06.txt AC 1 ms 3412 KiB
hand_07.txt AC 1 ms 3544 KiB
hand_08.txt AC 1 ms 3484 KiB
hand_09.txt AC 1 ms 3480 KiB
hand_10.txt AC 1 ms 3464 KiB
hand_11.txt AC 1 ms 3408 KiB
random_00.txt AC 1 ms 3452 KiB
random_01.txt AC 1 ms 3528 KiB
random_02.txt AC 1 ms 3480 KiB
random_03.txt AC 1 ms 3480 KiB
random_04.txt AC 1 ms 3440 KiB
random_05.txt AC 1 ms 3600 KiB
random_06.txt AC 1 ms 3468 KiB
random_07.txt AC 1 ms 3384 KiB
random_08.txt AC 1 ms 3596 KiB
random_09.txt AC 1 ms 3484 KiB
random_10.txt AC 1 ms 3528 KiB
random_11.txt AC 1 ms 3432 KiB
random_12.txt AC 1 ms 3520 KiB
random_13.txt AC 1 ms 3472 KiB
random_14.txt AC 1 ms 3384 KiB