QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#667114#5522. F*** 3-Colorable Graphsxhytom#RE 0ms3756kbC++232.5kb2024-10-22 21:06:342024-10-22 21:06:50

Judging History

你现在查看的是最新测评结果

  • [2024-10-22 21:06:50]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3756kb
  • [2024-10-22 21:06:34]
  • 提交

answer

/*
 
_/      _/    _/      _/    _/      _/   _/_/_/_/_/     _/_/       _/      _/ 
 _/    _/     _/      _/     _/    _/        _/       _/    _/     _/      _/            
  _/  _/      _/      _/      _/  _/         _/      _/      _/    _/_/  _/_/         
   _/_/       _/_/_/_/_/        _/           _/      _/      _/    _/  _/  _/          
  _/  _/      _/      _/        _/           _/      _/      _/    _/      _/          
 _/    _/     _/      _/        _/           _/       _/    _/     _/      _/          
_/      _/    _/      _/        _/           _/         _/_/       _/      _/       
 
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
using i64 = long long;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define multi int _;cin>>_;while(_--)
#define debug(x) cerr << #x << " = " << (x) << endl;
#define int long long
#define pb push_back
#define eb emplace_back
ll gcd(ll a,ll b){ return b?gcd(b,a%b):a;}
mt19937_64 mrand(chrono::steady_clock().now().time_since_epoch().count());
int rnd(int l,int r){ return mrand() % (r - l + 1) + l;}
void test() {cerr << "\n";}
template<typename T, typename... Args> 
void test(T x, Args... args) {cerr << x << " ";test(args...);}
const ll MOD = 998244353;
// const ll MOD = 1e9+7;
ll ksm(ll x,ll y){ll ans=1;x%=MOD;while(y){if(y&1)ans=ans*x%MOD;x=x*x%MOD,y/=2;}return ans;}

const int P1 = 972152273, base1 = 809;
const int P2 = 905563261, base2 = 919;
const ll N = 200005;
//head

std::bitset<10005> c[10005];

signed main()
{  
#ifdef localfreopen
    // freopen("1.in","r",stdin);
#endif
    fastio
    std::cout << std::fixed << std::setprecision(10);
    
    int n, m;
    std::cin >> n >> m;
    std::vector<std::vector<int>> adj(2 * n + 1);
    
    std::vector<std::pair<int, int>> edges;
    
    int N = std::sqrt(n);
    
    for (int i = 1; i <= m; i++) {
    	int u, v;
    	std::cin >> u >> v;
    	edges.push_back({u, v});
    	adj[u].push_back(v);
    	adj[v].push_back(u);
    	c[u][v] = 1;
    	c[v][u] = 1;
    }
    
   	for (int i = 1; i <= n; i++) {
   		std::bitset<10005> bs;
   		int cnt = 0, sum = 0;
   		for (auto x : adj[i]) {
   			bs |= c[x];
   			cnt += 1;
   			sum += c[x].count();
   		}
   		if (sum - cnt + 1 != bs.count()) {
   			std::cout << "2\n";
   			return 0;
   		}
   	}
   	std::cout << "3\n";
    
    
    
    
    
    
    
    
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3728kb

input:

2 4
1 3
1 4
2 3
2 4

output:

2

result:

ok 1 number(s): "2"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

3 5
1 4
2 4
2 5
3 5
3 6

output:

3

result:

ok 1 number(s): "3"

Test #3:

score: -100
Runtime Error

input:

10000 20000
4570 11730
8803 16440
4257 15381
4455 17636
5256 13543
2172 18421
7735 17847
8537 16010
6175 12263
1079 13410
335 15901
3272 16233
7435 11454
4469 13374
1564 13416
1264 13446
7484 14510
8193 12267
628 15585
1388 11398
5444 19958
2059 18140
8947 13188
6214 17707
7940 12253
6726 11508
1839...

output:


result: