結果

問題 No.313 π
ユーザー sugim48
提出日時 2015-09-02 16:51:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 1,664 ms
コンパイル使用メモリ 57,032 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-18 21:31:45
合計ジャッジ時間 2,361 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 24 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:29: warning: ‘y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   16 |         cout << x << ' ' << y << endl;
      |                             ^
main.cpp:16:22: warning: ‘x’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   16 |         cout << x << ' ' << y << endl;
      |                      ^~~

ソースコード

diff #

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

int a[10] = {20104, 20063, 19892, 20010, 19874, 20199, 19898, 20163, 19956, 19841};

int main() {
	string S; cin >> S;
	for (int i = 2; i < S.length(); i++)
		a[S[i] - '0']--;
	int x, y;
	for (int k = 0; k < 10; k++) {
		if (a[k] == -1) x = k;
		if (a[k] == 1) y = k;
	}
	cout << x << ' ' << y << endl;
}
0