結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
ユーザー tnakao0123
提出日時 2021-01-25 18:04:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 5 ms / 1,000 ms
コード長 803 bytes
コンパイル時間 906 ms
コンパイル使用メモリ 93,284 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-22 11:09:29
合計ジャッジ時間 2,155 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 1362.cc:  No.1362 [Zelkova 8th Tune] Black Sheep - yukicoder
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 500000;

/* typedef */

/* global variables */

char s[MAX_N + 4];
int cs[128], ps[128];

/* subroutines */

/* main */

int main() {
  scanf("%s", s);

  for (int i = 0; s[i]; i++)
    cs[s[i]]++, ps[s[i]] = i;

  for (int c = 0; c < 128; c++)
    if (cs[c] == 1) {
      printf("%d %c\n", ps[c] + 1, c);
      break;
    }

  return 0;
}
0