結果

問題 No.2246 1333-like Number
ユーザー yukster714yukster714
提出日時 2023-05-05 21:34:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 614 ms
コンパイル使用メモリ 64,000 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-02 15:26:46
合計ジャッジ時間 1,623 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:19:15: warning: 'ab' may be used uninitialized [-Wmaybe-uninitialized]
   19 |         cout<<ab;
      |               ^~
main.cpp:6:13: note: 'ab' was declared here
    6 |         int ab,b;
      |             ^~

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
    int n; cin>>n;
	int i =1;
	int ab,b;
	bool found = false;
	for(int a=1;a<10;a++){
		for(b=a+1;b<10;b++){
			if(i==n%36){
				ab =10*a+b;
				found = true;
			}
			if(found) break;
			i++;
		}
		if(found) break;
	}
	cout<<ab;
    if(n>36){
    	cout<<string(n/36,(char)b+'0');
    }
    cout <<endl;
    return 0;
}
0