結果

問題 No.304 鍵(1)
コンテスト
ユーザー ldsyb
提出日時 2016-04-25 15:56:48
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 273 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 339 ms
コンパイル使用メモリ 62,828 KB
最終ジャッジ日時 2026-05-10 04:24:23
合計ジャッジ時間 997 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:11:23: error: no match for 'operator==' (operand types are 'std::basic_istream<char>' and 'const char [9]')
   11 |       if(cin >> input == "unlocled") break;
      |          ~~~~~~~~~~~~ ^~ ~~~~~~~~~~
      |              |           |
      |              |           const char [9]
      |              std::basic_istream<char>
main.cpp:11:23: note: there are 15 candidates
   11 |       if(cin >> input == "unlocled") break;
      |          ~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/iosfwd:44,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ios:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ostream.h:43,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ostream:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/iostream:43,
                 from main.cpp:1:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/postypes.h:197:5: note: candidate 1: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
  197 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/postypes.h:197:5: note: template argument deduction/substitution failed:
main.cpp:11:26: note:   'std::basic_istream<char>' is not derived from 'const std::fpos<_StateT>'
   11 |       if(cin >> input == "unlocled") break;
      |                          ^~~~~~~~~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/string:45,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/locale_classes.h:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ios_base.h:43,
                 from /ho

ソースコード

diff #
raw source code

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

int main(){
   string input;
   for(int i = 0;i < 1000;i++){
      if(9 < i && i < 100) cout << "0";
      else if(i < 10) cout << "00";
      cout << i << endl;
      if(cin >> input == "unlocled") break;
   }
}
0