QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#469600 | #6700. Game on a Graph | zzisjtu# | AC ✓ | 78ms | 3680kb | C++23 | 852b | 2024-07-09 20:41:52 | 2024-07-09 20:41:53 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define all(x) x.begin(), x.end()
#define lowbit(i) ((i)&(-i))
#define pii pair<int,int>
#define endl '\n'
#define mk(x,y) make_pair(x,y)
#define popcount(x) __builtin_popcount(x)
const double pi=3.14159265358979323846;
const double eps=1e-9;
const int inf=1e9;
const long long INF=4e18;
const int mod=1e9+7;
using namespace std;
const int N=1e5+10;
void solve()
{
int k;
cin>>k;
string s;
cin>>s;
int n,m;
cin>>n>>m;
int ans=m-n+1;
ans%=k;
for(int i=1;i<=m;i++){
int u,v;
cin>>u>>v;
}
if(s[ans]=='1')cout<<2<<endl;
else cout<<1<<endl;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T=1;
cin>>T;
while(T--){
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3556kb
input:
3 5 11212 4 6 0 1 0 2 0 3 1 2 1 3 2 3 5 11121 5 7 0 2 1 3 2 4 0 3 1 2 3 2 4 1 3 121 4 3 0 1 0 2 1 3
output:
2 1 2
result:
ok 3 number(s): "2 1 2"
Test #2:
score: 0
Accepted
time: 78ms
memory: 3680kb
input:
1027 28 1122121222221112112121212112 58 72 32 31 15 56 42 56 31 3 52 57 54 50 47 5 40 22 41 36 42 50 30 28 16 6 28 42 40 23 3 0 4 24 3 50 23 29 53 6 20 27 39 30 7 10 40 43 14 48 27 47 0 6 12 9 25 56 49 41 30 55 13 54 5 11 30 44 6 5 49 34 22 33 1 29 4 39 33 38 35 33 40 2 38 55 47 52 32 52 10 47 26 43...
output:
1 1 2 1 2 2 1 2 1 2 2 2 2 2 1 2 1 2 1 2 2 2 2 1 2 2 1 1 2 1 2 1 2 1 2 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1 1 2 1 1 2 1 2 1 1 1 2 1 2 1 2 1 1 2 1 1 1 2 1 1 1 1 2 1 1 1 1 2 2 1 1 2 1 1 2 2 2 1 2 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 2 2 1 2 1 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 1 1 2 2 1 1 2 1 2 2 1 2 2 2 1 ...
result:
ok 1027 numbers