#include
#define ios ios::sync_with_stdio(0),cin.tie(0)
#define fi first
#define se second
#define pb push_back
#define PII pair
#define int long long
using namespace std;const int N = 2e5 + 100,M = N * 2,INF = 0x3f3f3f3f,mod = 1e9 + 7;
int n,m;void solve()
{int a,b;cin >> n >> a >> b;if(a + b <= n - 2 || n == 1) cout << "Yes" << endl;else cout << "No" << endl;
}signed main()
{ios; int T; cin >> T; while(T -- ) solve();return 0;
}
#include
#define ios ios::sync_with_stdio(0),cin.tie(0)
#define fi first
#define se second
#define pb push_back
#define PII pair
#define int long long
using namespace std;const int N = 2e5 + 100,M = N * 2,INF = 0x3f3f3f3f,mod = 1e9 + 7;
int n,m;
int a[N];
void solve()
{cin >> n;for(int i = 1;i <= n;i ++ ) cin >> a[i];if(n == 1) cout << "1" << endl;else{bool f = false;for(int i = 1;i <= n - 2;i ++ ){if(a[i] != a[i + 2]){f = true;break;}}if(f) cout << n << endl;else cout << (n + 2) / 2 << endl;}}signed main()
{ios; int T; cin >> T; while(T -- ) solve();return 0;
}
#include
#define ios ios::sync_with_stdio(0),cin.tie(0)
#define fi first
#define se second
#define pb push_back
#define PII pair
#define int long long
using namespace std;const int N = 210,M = N * 2,INF = 0x3f3f3f3f,mod = 1e9 + 7;int n,m;
char a[N][N];
int res[N][110];
int d[N];
int w[N];void bfs()
{queue q;int cnt = 0;for(int i = 1;i <= n;i ++ )if(d[i] == 0){q.push(i);++cnt;res[i][cnt] = 1;w[i] = 1;}while(q.size()){int t = q.front();q.pop();for(int j = 1;j <= n;j ++ ){if(a[t][j] == '1'){d[j]--;for(int k = 1;k <= n;k ++ )if(res[t][k] == 1 && res[j][k] != 1){w[j]++;res[j][k] = 1;}if(d[j] == 0){++cnt;w[j]++;q.push(j);res[j][cnt] = 1;}}}}
}
void solve()
{cin >> n;for(int i = 1;i <= n;i ++ )for(int j = 1;j <= n;j ++ ){cin >> a[i][j];if(a[i][j] == '1'){d[j]++;}}bfs();for(int i = 1;i <= n;i ++ ){cout << w[i] << ' ';for(int j = 1;j <= n;j ++ )if(res[i][j] == 1)cout << j << ' ';cout << endl;}for(int i = 1;i <= n;i ++ ){w[i] = 0;for(int j = 1;j <= n;j ++ )res[i][j] = 0;}}signed main()
{ios; int T; cin >> T; while(T -- ) solve();return 0;
}
D不会,好像自己这种算计数的大部分都不会,得加强一下练习了
上一篇:“老实人”赛力斯,巨亏百亿赌明天 赛力斯今日复盘 第一亏损大户赛力斯全年能亏多少
下一篇:剑南春|巴萨3-1客胜阿拉维斯,罗克连场破门+染红,莱万建功 巴萨1:1阿拉维斯阿圭罗下场 友谊赛巴萨胜皇马莱万与阿拉巴