結果

問題 No.353 ヘイトプラス
コンテスト
ユーザー gurualo
提出日時 2018-01-05 01:06:07
言語 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
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 1,161 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 589 ms
コンパイル使用メモリ 109,480 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-25 05:38:22
合計ジャッジ時間 1,113 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:49:17: warning: 'c' is used uninitialized [-Wuninitialized]
   49 |     cerr<<"c:"<<c<<endl;
      |                 ^
main.cpp:46:12: note: 'c' was declared here
   46 |     LL a,b,c;
      |            ^

ソースコード

diff #
raw source code

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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;


int main(){
 

    LL a,b,c;
    cin>>a>>b;
    LL ans=0;
    cerr<<"c:"<<c<<endl;
    do{
        c=(a&b)<<1;
        ans=a^b;
        a=ans;
        b=c;
        cerr<<a<<endl;
    }while(c!=0);
    cout<<ans<<endl;




}
0