結果

問題 No.1070 Missing a space
ユーザー IchimiyaIchimiya
提出日時 2020-06-10 01:46:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 721 bytes
コンパイル時間 1,643 ms
コンパイル使用メモリ 169,096 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-02 08:55:14
合計ジャッジ時間 3,623 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
	string C;
	cin >> C;
	//cout << stoi("01") << endl;
	//cout << to_string(1) << endl;

	int cnt = 0;
	vector<pair<int, int>> v;
	for (int i = 1; i < C.size(); i++) {
		string s1, s2, s3, s4;
		int n1, n2;

		s1 = C.substr(0, i);
		s2 = C.substr(i, C.size() - i);
		//cout << "s1:" << s1 << ' ' << "s2:" << s2 << endl;
		n1 = stoi(s1);
		n2 = stoi(s2);
		//cout << "n1:" << n1 << ' ' << "n2:" << n2 << endl;
		s3 = to_string(n1);
		s4 = to_string(n2);
		//cout << "s3:" << s3 << ' ' << "s4:" << s4 << endl;

		if ((s1 != s3) || (s2 != s4)) {
			continue;
		}
		else if ((n1 != 0) && (n2 != 0)) {
			cnt++;
		}
	}

	cout << cnt << endl;
}
0