Submission #00183


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
using namespace std;
int main(){
char knot[5000];
cin >> knot;
if( strcmp( knot ,"Hello World" ) == 0 ){
long long int n;
int cnt = 0;
cin >> n;
while( n != 1 ){
cnt++;
if( n%2 != 0 ){
n *= 3;
n++;
}
else{
n /= 2;
}
}
if( !cnt && n != 1 ) cout << "Counterexample for Collatz conjecture!" << endl;
else cout << cnt << endl;
}
}

ステータス

項目 データ
問題 0005 - 二重否定除去法則
ユーザー名 platon
投稿日時 2015-08-28 11:57:19
言語 C++11
状態 Compile Error
得点 0
ソースコード長 442 Byte
最大実行時間 -
最大メモリ使用量

コンパイルメッセージ

./183.cpp: In function ‘int main()’:
./183.cpp:7:35: error: ‘strcmp’ was not declared in this scope
   if( strcmp( knot ,"Hello World" ) == 0 ){
                                   ^

セット

セット 得点 Cases

テストケース

ファイル名 状態 実行時間 メモリ使用量 #