提出 #62035823


ソースコード 拡げる

#include "bits/stdc++.h"
// #include "algotester.h"
// #include "algotester_generator.h"
using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef long long Int;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL) INF;

const int MAX = 111;

int A[MAX];
int n;

bool check(LL a, LL b, LL c, LL d)
{
	return a * d == c * b;
}

bool check()
{
	FOR (i, 1, n)
	{
		if (!check(A[i], A[i-1], A[1], A[0])) return false;
	}
	return true;
}

int main(int argc, char* argv[])
{
	//ios::sync_with_stdio(false); cin.tie(0);

	scanf("%d", &n);
	FOR (i, 0, n)
	{
		scanf("%d", &A[i]);
	}

	if (check()) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;

}

提出情報

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

コンパイルエラー

Main.cpp: In function ‘int main(int, char**)’:
Main.cpp:44:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
   44 | int main(int argc, char* argv[])
      |          ~~~~^~~~
Main.cpp:44:26: warning: unused parameter ‘argv’ [-Wunused-parameter]
   44 | int main(int argc, char* argv[])
      |                    ~~~~~~^~~~~~
Main.cpp:48:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   48 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
Main.cpp:51:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   51 |                 scanf("%d", &A[i]);
      |                 ~~~~~^~~~~~~~~~~~~

ジャッジ結果

セット名 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 3572 KiB
example_01.txt AC 1 ms 3640 KiB
example_02.txt AC 1 ms 3648 KiB
hand_00.txt AC 1 ms 3496 KiB
hand_01.txt AC 1 ms 3620 KiB
hand_02.txt AC 1 ms 3636 KiB
hand_03.txt AC 1 ms 3860 KiB
hand_04.txt AC 1 ms 3664 KiB
hand_05.txt AC 1 ms 3664 KiB
hand_06.txt AC 1 ms 3724 KiB
hand_07.txt AC 1 ms 3664 KiB
hand_08.txt AC 1 ms 3568 KiB
hand_09.txt AC 1 ms 3860 KiB
hand_10.txt AC 1 ms 3564 KiB
hand_11.txt AC 1 ms 3668 KiB
random_00.txt AC 1 ms 3604 KiB
random_01.txt AC 1 ms 3668 KiB
random_02.txt AC 1 ms 3572 KiB
random_03.txt AC 1 ms 3696 KiB
random_04.txt AC 1 ms 3632 KiB
random_05.txt AC 1 ms 3556 KiB
random_06.txt AC 1 ms 3664 KiB
random_07.txt AC 1 ms 3560 KiB
random_08.txt AC 1 ms 3696 KiB
random_09.txt AC 1 ms 3664 KiB
random_10.txt AC 1 ms 3672 KiB
random_11.txt AC 1 ms 3720 KiB
random_12.txt AC 1 ms 3696 KiB
random_13.txt AC 1 ms 3544 KiB
random_14.txt AC 1 ms 3672 KiB