結果

問題 No.18 うーさー暗号
ユーザー gotutiyangotutiyan
提出日時 2017-09-30 00:08:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 639 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 70,080 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 16:25:34
合計ジャッジ時間 1,032 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 WA -
testcase_02 AC 2 ms
6,944 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int binary_search(int, std::vector<int>, int)':
main.cpp:30:1: warning: control reaches end of non-void function [-Wreturn-type]
   30 | }
      | ^

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;

int max(int a, int b) {
	int x = (a > b) ? a : b;
	return x;
}

int min(int a, int b) {
	int x = (a < b) ? a : b;
	return x;
}

int binary_search(int n, vector<int> v,int key) {
	int left=0, right=n;

	while (left < right) {
		int mid = (left + right) / 2;
		if (v[mid] == key) return mid;
		else if (v[mid] < key) {
			left = mid + 1;
		}
		else if (v[mid] > key) {
			right = mid - 1;
		}
	}
}

int main() {
	string s;
	cin >> s;
	for (int i = 0; i < s.length(); i++) {
		s[i] -= (i + 1)%26;
		cout << s[i];
	}
	cout << endl;
	return 0;
}
0