結果

問題 No.1942 Leading zero
ユーザー ramia777ramia777
提出日時 2022-05-27 17:32:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 1,354 bytes
コンパイル時間 707 ms
コンパイル使用メモリ 91,676 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 19:46:08
合計ジャッジ時間 1,198 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 17 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// yukicodr
//No.1942
// Leading zero



//二次元可変配列
//vector <vector <int>> mass;
//vector <vector <int>> memo;
//vector <int> memo;


//#include "stdafx.h"
#include <iostream>
#include <vector>
#include <list>//list
#include <set> //tree
#include <map> //連想配列
#include <unordered_set> //hash
#include <unordered_map> //hash
#include <algorithm>
#include <iomanip>
#include <cstring>
//#include <bits/stdc++.h>

using namespace std;

#define FOR(x,to) for(x=0;x<to;x++)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))


typedef unsigned long long ULL;
typedef signed long long SLL;





//昇順
int compare_up(const int * a, const int *b)
{
	if (*a > *b)
		return (1);
	else if (*a < *b)
		return (-1);
	return (0);
}

//降順
int compare_down(const int * a, const int *b)
{
	if (*a > *b)
		return (-1);
	else if (*a < *b)
		return (1);
	return (0);
}

int solve(int i, ULL index_flag)
{

	return 0;
}

int N;
char s[10005][5];

int main()
{
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> s[i][0];
		cin >> s[i][1];
		cin >> s[i][2];
		cin >> s[i][3];
		cin >> s[i][4];
	}

	int OK;
	for (int i = 0; i < N; i++)
	{
		OK = 0;
		for (int j = 0; j < 5; j++)
		{
			if (s[i][j] != '0' || OK || j == 4)
			{
				cout << s[i][j];
				OK = 1;
			}
		}
		cout << endl;
	}

	//getchar();
	return 0;

}

0