結果
| 問題 |
No.2608 Divide into two
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-01-27 02:34:43 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 1,880 bytes |
| コンパイル時間 | 2,089 ms |
| コンパイル使用メモリ | 192,936 KB |
| 最終ジャッジ日時 | 2025-02-19 00:05:09 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll linf=(1LL<<60) - 1;
const int inf=(1LL<<30) - 1;
const int mod=1000000007;
const int MOD=998244353;
const ll dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const ll dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
#define overload4(a,b,c,d,name,...) name
#define rep1(n) for(long long _=0;_<n;++_)
#define rep2(i,n) for(long long i=0;i<n;++i)
#define rep3(i,a,b) for(long long i=a;i<b;++i)
#define rep4(i,a,b,c) for(long long i=a;i<b;i+=c)
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
#define vv(type,name,h,...) vector name(h,vector<type>(__VA_ARGS__))
#define vvv(type,name,h,w,...) vector name(h,vector(w,vector<type>(__VA_ARGS__)))
#define vvvv(type, name, h, w, n, ...) vector<vector<vector<vector<type>>>> name(h, vector<vector<vector<type>>>(w, vector<vector<type>>(n, vector<type>(__VA_ARGS__))))
struct Setting{ Setting(){ cin.tie(nullptr)->sync_with_stdio(0); fixed(cout).precision(12); } }Setting;
// #define _GLIBCXX_DEBUG
//-----------------------------------
void solve() {
int N; cin >> N;
int t = N % 4;
if(t==1 || t==2){
cout << -1 << endl;
}else{
if(t==0){
rep(i, 1, N+1){
int r = i % 4;
if(r == 2 || r == 3) {
cout << 1;
}else{
cout << 0;
}
}
}else{
rep(i, 1, N+1){
int r = i % 4;
if(r == 1 || r == 2){
cout << 1;
}else{
cout << 0;
}
}
}
cout << endl;
}
}
int main() {
int T = 1;
cin >> T;
while(T--) solve();
}