提出 #64030605


ソースコード 拡げる

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

//#define filename "xxx" 
#define FileOperations() freopen(filename".in", "r", stdin), freopen(filename".out", "w", stdout)
//#define multi_cases 1

#define inf 0x3f3f3f3f
#define Linf 0x3f3f3f3f3f3f3f3f
#define pii pair<int, int> 
#define all(v) v.begin(), v.end()
#define upw(i, a, b) for(int i = (a); i <= (b); ++i)
#define dnw(i, a, b) for(int i = (a); i >= (b); --i)

template<class T> bool vmax(T &a, T b) { return b > a ? a = b, true : false; }
template<class T> bool vmin(T &a, T b) { return b < a ? a = b, true : false; }
template<class T> void clear(T &x) { T().swap(x); }

// const int N = ;

int n;

void Traveller() {
	cin >> n;
	if(n & 1) {
		upw(i, 1, n/2) cout << '-';
		cout << '=';
		upw(i, 1, n/2) cout << '-';
	}
	else {
		upw(i, 1, n/2 - 1) cout << '-';
		cout << '=' << '=';
		upw(i, 1, n/2 - 1) cout << '-';
	}
}

signed main() {
#ifdef filename
	FileOperations();
#endif
	
	signed _ = 1;
#ifdef multi_cases
	scanf("%d", &_);
#endif
	while(_--) Traveller();
	return 0;
}

提出情報

提出日時
問題 A - Doors in the Center
ユーザ Wangfengchi
言語 C++ 23 (Clang 16.0.6)
得点 100
コード長 1091 Byte
結果 AC
実行時間 1 ms
メモリ 3512 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 2
AC × 10
セット名 テストケース
Sample sample_01.txt, sample_02.txt
All random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt
ケース名 結果 実行時間 メモリ
random_03.txt AC 1 ms 3412 KiB
random_04.txt AC 1 ms 3492 KiB
random_05.txt AC 1 ms 3480 KiB
random_06.txt AC 1 ms 3512 KiB
random_07.txt AC 1 ms 3460 KiB
random_08.txt AC 1 ms 3456 KiB
random_09.txt AC 1 ms 3504 KiB
random_10.txt AC 1 ms 3484 KiB
sample_01.txt AC 1 ms 3480 KiB
sample_02.txt AC 1 ms 3476 KiB