結果

問題 No.1798 Financial Quiz
ユーザー Digwee_kkknDigwee_kkkn
提出日時 2022-01-02 02:16:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,902 bytes
コンパイル時間 1,586 ms
コンパイル使用メモリ 162,540 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-21 07:23:50
合計ジャッジ時間 5,360 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std; 
typedef long long ll;
typedef float fl;
typedef bool bl;
typedef string st;
typedef pair<int,int> P;
const int INF=100000000;
const ll INFx=1000000000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
string fi="01234567890123456789";
string al="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
string AL="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ";
#define rep(i,n) for(int i=0;i<(n);++i)
#define YESNO(flag) if(flag){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(flag) if(flag){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(flag) if(flag){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}


int main(){
  int h,w,sum=1,hantei; cin>>h>>w;
  for(int i=0;i<h-2;i+=2){
    for(int j=0;j<w;++j){
          hantei=0; //0なら偶数列,1なら奇数列
          for(int k=1;k<=i+1;k+=2){
            if(hantei==0){
              hantei=1;
            }else{
              hantei=0;
            }
          }
          if (hantei==0&&j%2==1){
            sum++;
          }else if(hantei==1&&j%2==0){
            sum++;
          }
    }
  }
  cout<<sum;
} 

                                                                                                                           /*  
+++++        ++                                
++  +++                   +                                                                    /\          /\
++    +++    ++          ++                                                                   /  \        /  \
++      ++   ++     ++++++++++  +++        ++++      +++      +++++       +++++              /    \      /    \
++      ++   ++     ++      ++    +++     ++++++    +++     ++     ++   ++     ++          
++    +++    ++     ++      ++      +++  +++  +++  +++      ++++++++++  ++++++++++
++  +++      ++     ++++++++++       ++++++    ++++++       ++          ++ 
+++++        ++          ++           ++++      ++++         ++++++++    ++++++++               "Lets Enjoy!"   
                    ++++++++++     
                    ++      ++    
                    ++      ++
                    ++++++++++                                                                               
 
                                         Λ  Λ    / ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
                                        ( ゚ー゚)< now rating【157】+55 
                                          ̄ ̄    \___________
    人     / ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
 ( ゚ー゚)<  #灰coderですがなにか                                                                                                                                                
    ̄ ̄    \___________

                                                                                                                          */
0