結果

問題 No.397 NO MORE KADOMATSU
ユーザー srup٩(๑`н´๑)۶srup٩(๑`н´๑)۶
提出日時 2016-07-15 23:02:26
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 958 bytes
コンパイル時間 606 ms
コンパイル使用メモリ 74,400 KB
実行使用メモリ 24,384 KB
平均クエリ数 935.83
最終ジャッジ日時 2023-09-23 11:04:05
合計ジャッジ時間 3,945 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 25 ms
23,676 KB
testcase_02 AC 25 ms
23,532 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 26 ms
23,532 KB
testcase_10 WA -
testcase_11 AC 25 ms
23,256 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 26 ms
23,880 KB
testcase_17 AC 25 ms
23,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)

int a[101];
int n;
void sort(void){
	bool zerof = 1;
	bool flag = 1;
	for (int i = 0; flag; ++i){
		flag = 0;
		for (int j = n - 1; j >= i ; --j){
			if(a[j] < a[j - 1]){
				swap(a[j], a[j - 1]);
				printf("%d %d\n", j - 1, j);
				flag = 1;
				zerof = 0;
			}
		}
	}
	if(zerof) printf("0\n");
	return;
}
int main(void){
	cin >> n;
	rep(i, n) cin >> a[i];
	sort();
	int d;
	cin >> d;
	return 0;

}
0