submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s930940122 | p03746 | C | #include <stdio.h>
int main(void){
int n, m;
scanf("%d %d", &n, &m);
int a[m], b[m], g[n+1][n+1], c[n+1];
for(int i=0; i<=n; i++){
for(int j=0; j=<n; j++){
g[i][j]=0;
}
c[i]=0;
}
for(int i=0; i<m; i++){
scanf("%d %d", &a[i], &b[i]);
g[a[i]][b... | main.c: In function 'main':
main.c:8:24: error: expected expression before '<' token
8 | for(int j=0; j=<n; j++){
| ^
|
s722056084 | p03746 | C | #include <stdio.h>
#include <string.h>
#define MaxSize 100000
char neighbour[MaxSize][MaxSize];
char visited[MaxSize];
char nbCount[MaxSize];
int startPath[MaxSize];
int endPath[MaxSize];
int startPathLen = 0;
int endPathLen = 0;
void searchEnd(int end, int pathArr[], int * pLength) {
char allNbSearched = 0;
c... | main.c: In function 'main':
main.c:33:34: warning: integer overflow in expression of type 'int' results in '1410065408' [-Woverflow]
33 | memset(neighbour, 0, MaxSize * MaxSize);
| ^
/tmp/cczSm0OR.o: in function `searchEnd':
main.c:(.text+0x58): relocation truncated to fit:... |
s008456071 | p03746 | C | #include <stdio.h>
#define MaxSize 100000
char neighbour[MaxSize][MaxSize];
char visited[MaxSize];
char nbCount[MaxSize];
int startPath[MaxSize];
int endPath[MaxSize];
int startPathLen = 0;
int endPathLen = 0;
void searchEnd(int end, int pathArr[], int * pLength) {
char allNbSearched = 0;
char foundNew = 0;
... | main.c: In function 'main':
main.c:32:5: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
32 | memset(neighbour, 0, MaxSize * MaxSize);
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'memset'
1 | #include <stdio.h>
+++ |+#include <str... |
s583922432 | p03746 | C++ | #include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#define pb push_back
#define pii pair<int,int>
using namespace std;
int n,m,num,ima;
vector<vector<int> > g;
vector<int> vis;
vector<int> res,tmp;
vector<pii> p;
void dfs(int doko){
int i;
//cout<<doko<<" ";
tmp.pb(doko);... | a.cc: In function 'int main()':
a.cc:66:9: error: 'j' was not declared in this scope
66 | for(j=0;j<=n;j++){
| ^
|
s649112455 | p03746 | C++ | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
const int MAXN=1e5+10;
vector<int> v[MAXN];
int vis[MAXN], path[MAXN], tag[MAXN], ans=0, e=0;
void dfs(int x){
e=x;
vis[x]=1;
for(int i=0; i<v[x].size(); i++){
int p=v[x][i];
if(!vis[p]){
dfs(p)... | a.cc: In function 'int main()':
a.cc:46:17: error: 'flag' was not declared in this scope; did you mean 'flag2'?
46 | flag=false;
| ^~~~
| flag2
a.cc:52:17: error: 'flag' was not declared in this scope; did you mean 'flag2'?
52 | flag=fals... |
s540319215 | p03746 | C++ | #include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
int N,M;
cin >> N >> M;
int a;
for(int i=0; i < 2*M)
cin >> a;
cout << 1 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:23: error: expected ';' before ')' token
15 | for(int i=0; i < 2*M)
| ^
| ;
|
s235055305 | p03746 | C++ | #include <iostream>
#include <vector>
using namespace std;
int N, M;
bool Use[100005];
vector <int> G[100005];
int Father[100005];
int leaf;
int Level[100005];
vector <int> Leaf;
vector <int> Sol, Sol2;
void Read()
{
cin >> N >> M;
for(int i = 1; i <= M; i++)
{
int x, y;
cin >> x >> y;
... | a.cc: In function 'void Print()':
a.cc:63:5: error: 'reverse' was not declared in this scope
63 | reverse(Sol2.begin(), Sol2.end());
| ^~~~~~~
|
s634481893 | p03746 | C++ | #include <iostream>
#include <vector>
using namespace std;
int N, M;
bool Use[100005];
vector <int> G[100005];
int Father[100005];
int leaf;
int Level[100005];
vector <int> Leaf;
vector <int> Sol, Sol2;
void Read()
{
cin >> N >> M;
for(int i = 1; i <= M; i++)
{
int x, y;
cin >> x >> y;
... | a.cc: In function 'void Print()':
a.cc:63:5: error: 'reverse' was not declared in this scope
63 | reverse(Sol2.begin(), Sol2.end());
| ^~~~~~~
|
s094917540 | p03746 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn = 100010;
const int inf = 0x0fffffff;
#define LL long long
const long long mod = 1000000007;
vector <int> edge[maxn];
bool vis[maxn];
bool dfs(int v, vector<int> &path)
{
vis[v] = true;
path.push_back(v... | a.cc: In function 'int main()':
a.cc:40:9: error: 'memset' was not declared in this scope
40 | memset(vis, false, sizeof(vis));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <algorithm>
+++ |+#inclu... |
s771525876 | p03746 | C++ | #include <iostream>
#include <vector>
using namespace std;
int N,M;
int mat[100000][100000] = {0};
vector<int> ans;
int visited[100000] = {0};
void DFS(int v)
{
ans.push_back(v+1);
visited[v] = 1;
for(int i=0;i<N;i++){
if(mat[v][i]==1 && visited[i]==0){
DFS(i);
return;
}
}
return;
}
int main()
{
cin ... | /tmp/ccv4BT3Y.o: in function `DFS(int)':
a.cc:(.text+0x1e): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccv4BT3Y.o
a.cc:(.text+0x3a): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccv4BT3Y.o
a.cc:(.text+0x8a): relo... |
s623588764 | p03746 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
using namespace std;
int n,m,a,b;
vector<int> v[100010];
bool vis[100010];
stack<int> st,cop;
bool DFS(int x,int find,int not){
vis[x]=1,st.push(x);
if(x==find)return true;
for(int i=0;i<v[x].size();i++){
if(!vis[v[x][i]]&&v[x][i]!=not){
... | a.cc:13:29: error: expected ',' or '...' before 'not' token
13 | bool DFS(int x,int find,int not){
| ^~~
a.cc: In function 'bool DFS(int, int, int)':
a.cc:18:47: error: expected primary-expression before ')' token
18 | if(!vis[v[x][i]]&&v[x][i]!=not){
| ... |
s014353758 | p03746 | C++ | #include <cstdio>
#define R register
#define maxn 100010
struct Edge {
Edge *next;
int to;
}*last[maxn], e[maxn << 1], *ecnt = e;
int deg[maxn];
inline void link(R int a, R int b)
{
++deg[a]; ++deg[b];
*++ecnt = (Edge) {last[a], b}; last[a] = ecnt;
*++ecnt = (Edge) {last[b], a}; last[b] = ecnt;
}
bool vis[maxn];
... | a.cc:10:24: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10 | inline void link(R int a, R int b)
| ^
a.cc:10:33: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10 | inline void link(R int a, R int b)
| ... |
s539521682 | p03746 | C++ | #include <cstdio>
#define R register
#define maxn 100010
struct Edge {
Edge *next;
int to;
}*last[maxn], e[maxn << 1], *ecnt = e;
int deg[maxn];
inline void link(R int a, R int b)
{
++deg[a]; ++deg[b];
*++ecnt = (Edge) {last[a], b}; last[a] = ecnt;
*++ecnt = (Edge) {last[b], a}; last[b] = ecnt;
}
bool vis[maxn];
... | a.cc:10:24: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10 | inline void link(R int a, R int b)
| ^
a.cc:10:33: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10 | inline void link(R int a, R int b)
| ... |
s174670496 | p03746 | C++ | #include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define s second
#define f first
#define mk make_pair
bool a[100001][100001],used[100001];
int n,m;
main(){
cin>>n>>m;
r(i,m){
int p1,p2;
cin>>p1>>p2;
a[p1][p2]=a[p2][p1]=1;
}
queue<int>l;
queue<int>q;
r(j,n){r(i,n+1)used[i]=... | a.cc:9:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
9 | main(){
| ^~~~
/tmp/cckV7qmJ.o: in function `main':
a.cc:(.text+0xf): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0x2b): relocation truncated to ... |
s910428221 | p03746 | C++ | #include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define s second
#define f first
#define mk make_pair
int a[100001][100001],used[100001];
int n,m;
main(){
cin>>n>>m;
r(i,m){
int p1,p2;
cin>>p1>>p2;
a[p1][p2]=a[p2][p1]=1;
}
queue<int>l;
queue<int>q;
r(j,n){r(i,n+1)used[i]=0... | a.cc:9:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
9 | main(){
| ^~~~
/tmp/cc2fxpfI.o: in function `main':
a.cc:(.text+0xf): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0x2b): relocation truncated to ... |
s947969196 | p03746 | C++ | #include<cstdio>
using namespace std;
int a[100005],b[100005];
int main(){
int n,m,i;
scanf("%d%d",&n,&m);
for(i=0;i<m;i++){
scanf("%d%d",&a[i],&b[i]);
}
printf("2\n%d %d\n",a[0],b[0]);
} | a.cc: In function 'int main()':
a.cc:7:16: error: expected ')' before '\U0000ff09'
7 | for(i=0;i<m;i++){
| ~ ^~
| )
a.cc:7:16: error: '\U0000ff09' was not declared in this scope
7 | for(i=0;i<m;i++){
| ^~
|
s851817579 | p03746 | C++ | #include<cstdio>
int a[100005],b[100005];
int main(){
int n,m,i;
scanf("%d%d",&n,&m);
for(i=0;i<m;i++){
scanf("%d%d",&a[i],&b[i]);
}
printf("2\n%d %d\n",a[0],b[0]);
} | a.cc: In function 'int main()':
a.cc:6:16: error: expected ')' before '\U0000ff09'
6 | for(i=0;i<m;i++){
| ~ ^~
| )
a.cc:6:16: error: '\U0000ff09' was not declared in this scope
6 | for(i=0;i<m;i++){
| ^~
|
s764798751 | p03746 | C++ | #include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define s second
#define f first
#define mk make_pair
int n,m;
int main(){
cin>>n>>m;
int a[n+1][n+1]={0};
r(i,m){
int p1,p2;
cin>>p1>>p2;
a[p1][p2]=a[p2][p1]=1;
}
r(i,n){
r(j,n){
if(a[i+1][j+1]){
cout<<2<<endl<<i+1<<... | a.cc:20:53: error: empty character constant
20 | cout<<2<<endl<<i+1<<''<<j+1<<endl;
| ^~
|
s842990203 | p03746 | C++ | #include <bits/stdc++.h>
using namespace std;
#ifdef WIN32
#define lld "%I64d"
#else
#define lld "%lld"
#endif
#define mp make_pair
#define pb push_back
#define put(x) { cout << #x << " = "; cout << (x) << endl; }
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef double... | a.cc: In function 'int main()':
a.cc:49:21: error: expected ',' or ';' before 'v2'
49 | int v1 = -1 v2 = -1;
| ^~
a.cc:55:26: error: 'v2' was not declared in this scope; did you mean 'v1'?
55 | v1 = ai, v2= bi;
| ^~
| ... |
s936676355 | p03746 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i = a; i < (b); ++i)
#define rrep(i,a,b) for(int i = b; i --> (a);)
#define all(v) v.begin(),v.end()
#define trav(x,v) for(auto &x : v)
#define sz(v) (int)(v).size()
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
int mai... | a.cc:29:15: error: extended character is not valid in an identifier
29 | vis[0] = 1;
| ^
a.cc: In function 'int main()':
a.cc:29:15: error: expected ';' before '\U000000a0'
29 | vis[0] = 1;
| ^
| ;
a.cc:29:14: warning: ignoring return v... |
s068546207 | p03747 | C++ | #include <bits/stdc++.h>
#define f first
#define s second
#define int long long
using namespace std;
using ll = long long;
using ii = pair<int, int>;
constexpr int MN = 1e5+5;
pair<ii, int> A[MN];
ii pos[MN];
int ans[MN];
main() {
if (fopen("in", "r")) freopen("in", "r", stdin), freopen("out", "w", stdout);
ios_bas... | a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
14 | main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:32:35: error: no matching function for call to 'max(long long int, int)'
32 | cnt += max((2*T-d)/L+1, 0);
| ... |
s772507266 | p03747 | Java | import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.util.Arrays;
import lib.io.ExtendedScanner;
import lib.io.Out;
public class Main {
public static void main(String[] args) throws Exception {
Field f = System.out.getClass().getDeclaredField("autoFlush");
... | Main.java:6: error: package lib.io does not exist
import lib.io.ExtendedScanner;
^
Main.java:7: error: package lib.io does not exist
import lib.io.Out;
^
Main.java:25: error: cannot find symbol
public static void solve(ExtendedScanner sc, Out out) {
^
symbol:... |
s658815798 | p03747 | C++ | #include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
#include <unordered_map>
#include <fstream>
#include <ctim... | a.cc: In function 'int main()':
a.cc:83:70: error: no matching function for call to 'std::pair<long long int, long long int>::pair(long long int)'
83 | id += lower_bound(all(v[1]),P(i.first+2*t-2*L), -inf) - v[1].begin();
| ... |
s482836142 | p03747 | C++ | #include<bits/stdc++.h>
const int maxn = 100035;
int a[maxn],n,l,t,x,cnt;
int main()
{
scanf("%d%d%d",&n,&l,&t);
for (int i=1; i<=n; i++)
{
scanf("%d%d",&a[i],&x);
a[i] += x==1?t:-t;
cnt += a[i]/l;
if (a[i]%l<0) cnt--; //就是这里细节的处理
((a[i]%=l)+=l)%=l;
}
... | a.cc:14:29: error: extended character is not valid in an identifier
14 | if (a[i]%l<0) cnt--; //就是这里细节的处理
| ^
a.cc:14:29: error: extended character is not valid in an identifier
a.cc:14:29: error: extended character is not valid in an identifier
a.cc:14:29: erro... |
s066153414 | p03747 | C++ | #include<algorithm>
#include<cstdio>
#include<iostream>
#include<cmath>
#define N 200005
using namespace std;
int n,l,t;
long long Rank
int x[N],w[N],e[N];
int main()
{
scanf("%d%d%d",&n,&l,&t);
Rank=1;
for (int i=1;i<=n;i++)
{
scanf("%d%d",&x[i],&w[i]);
e[i]=x[i]+((w[i]==1)?1:-1)*t;
e[i]%=l;
e[i]=(e[i]+l)%... | a.cc:9:1: error: expected initializer before 'int'
9 | int x[N],w[N],e[N];
| ^~~
a.cc: In function 'int main()':
a.cc:13:9: error: 'Rank' was not declared in this scope
13 | Rank=1;
| ^~~~
a.cc:16:31: error: 'x' was not declared in this scope
16 | scanf("%d%d",&x[i]... |
s191115282 | p03747 | C++ | #define ENABLE_DEBUG 1
// Kana's kitchen {{{
#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
#define LOOP(k) for(i64 ngtkana_is_a_genius=0; ngtkana_is_a_genius<(i64)k; ngtkana_is_a_genius++)
using i32 = std::int_least32_t;
using i64 = std::int_least64_t;
using u32 = std::uint_least32_t;
using u64 = st... | a.cc:45:7: error: stray '#' in program
45 | }a#define ENABLE_DEBUG 1
| ^
a.cc: In function 'int main()':
a.cc:45:6: error: 'a' was not declared in this scope
45 | }a#define ENABLE_DEBUG 1
| ^
a.cc:57:1: error: a template declaration cannot appear at block scope
57 | template <cla... |
s180032207 | p03747 | C++ | int main() {
std::cin.tie(0); std::ios::sync_with_stdio(false);
int N; double L, T; std::cin >> N >> L >> T;
std::vector<double> x(N), v(N), a(N);
T -= 1.0/16.0;
for(int i = 0; i < N; ++i) {
int X, W; std::cin >> X >> W;
x[i] = X;
if(W == 1) {
v[i] = 1.0;
a[i] = std::fmod(x[i] + T, L);... | a.cc: In function 'int main()':
a.cc:2:8: error: 'cin' is not a member of 'std'
2 | std::cin.tie(0); std::ios::sync_with_stdio(false);
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | int m... |
s036349977 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
int main () {
int N, L, T;
cin >> N >> L >> T;
vector<tuple<int, int, int>>an(N);
for (int i = 0; i < N; i ++) {
int x, w;
cin >> x >> w;
an[i] = make_tuple(x, w, i);
}
int num = 0;
for (int i = 1; i < N; i ++) {
if (get<1>an[i] == get<1>an[0]) ... | a.cc: In function 'int main()':
a.cc:14:15: error: expected ')' before 'an'
14 | if (get<1>an[i] == get<1>an[0]) continue;
| ~ ^~
| )
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
from a.cc:1:
/usr/include/c++/14/variant: In in... |
s438103021 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N, L, T;
cin >> N >> L >> T;
vector<int> x(N+1);
vector<int> w(N+1);
for(int i = 0; i < N; i++){
cin >> x[i] >> w[i];
}
x[N] = x[0];
w[N] = w[0];
for(int t = 1; t <= T; t++){
for(int i = 0; i < N; i++){
if((x[i] == x[i+1]-... | a.cc: In function 'int main()':
a.cc:37:13: error: 'i' was not declared in this scope
37 | cout << x[i]+1 << endl;
| ^
|
s500636096 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
int name(){
int N, L, T;
cin >> N >> L >> T;
vector<int> x(N+1);
vector<int> w(N+1);
for(int i = 0; i < N; i++){
cin >> x[i] >> w[i];
}
x[N] = x[0];
w[N] = w[0];
for(int t = 1; t <= T; t++){
for(int i = 0; i < N; i++){
if((x[i] == x[i+1]-... | a.cc: In function 'int name()':
a.cc:40:1: warning: no return statement in function returning non-void [-Wreturn-type]
40 | }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exi... |
s292751252 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
int name(){
int N, L, T;
cin >> N >> L >> T;
vector<int> x(N+1);
vector<int> w(N+1);
for(int i = 0; i < N; i++){
cin >> x[i] >> w[i];
}
x[N] = x[0];
w[N] = w[0];
for(int t = 1; t <= T; t++){
for(int i = 0; i < N; i++){
if((x[i] == x[i+1]-... | a.cc: In function 'int name()':
a.cc:22:26: error: expected ';' before 'x'
22 | x[i] = (x[i]-1)%L
| ^
| ;
23 | x[i+1] = (x[i]+1)%L
| ~
a.cc:38:9: error: no match for 'operator<<' (operand types are 'std::... |
s868859248 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
int name(){
int N, L, T;
cin >> N >> L >> T;
vector<int> x(N+1);
vector<int> w(N+1);
for(int i = 0, i < N; i++){
cin >> x[i] >> w[i];
}
x[N] = x[0];
w[N] = w[0];
for(int t = 1; t <= T; t++){
for(i = 0; i < N; i++){
if((x[i] == x[i+1]-1 ||... | a.cc: In function 'int name()':
a.cc:9:19: error: expected ';' before '<' token
9 | for(int i = 0, i < N; i++){
| ^~
| ;
a.cc:9:20: error: expected primary-expression before '<' token
9 | for(int i = 0, i < N; i++){
| ^
a.cc:16:9: erro... |
s988536452 | p03747 | C++ | #include<bits/sydc++.h>
using namespace std;
int name(){
int N, L, T;
cin >> N >> L >> T;
vector<int> x(N+1);
vector<int> w(N+1);
for(int i = 0, i < N; i++){
cin >> x[i] >> w[i];
}
x[N] = x[0];
w[N] = w[0];
for(int t = 1; t <= T; t++){
for(i = 0; i < N; i++){
if((x[i] == x[i+1]-1 ||... | a.cc:1:9: fatal error: bits/sydc++.h: No such file or directory
1 | #include<bits/sydc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s441220620 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,L,T;
cin>>N>>L>>T;
int x[N],w[N];
for(int i=0;i<N;i++)cin>>x[i]>>w[i];
int count=0;
int y[N];
for(int i=0;i<N;i++){
if(w[i]==1) {
y[i]=(x[i]+T)%L;
count+=(x[i]+T)/L;
}
else {
... | a.cc: In function 'int main()':
a.cc:37:2: error: expected '}' at end of input
37 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s472472865 | p03747 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(long long i=0;i<(n);i++)
#define ll long long
using namespace std;
int main(){
ll L,N,T;
vector<ll> X;
vector<int> W;
cin >> N >> L >> T;
rep(i,N) {
ll a,b;
cin >> a >> b;
X.push_back(a);W.push_back(b);
};
vector<ll> ans; l... | a.cc: In function 'int main()':
a.cc:32:23: error: 'n' was not declared in this scope
32 | if(p < 0) p = n + p;
| ^
|
s094427342 | p03747 | C++ | #include <bits/stdc++.h>
int N, L, T;
float X[110000];
int W[110000];
int main () {
cin >> N >> L >> T;
for (int i = 1; i < N + 1; i++) cin >> X[i] >> W[i];
for (float t = 0.5; t <= T; t += 0.5) {
//t秒のときの位置へ移動
for (int i = 1; i < N + 1; i++) {
if (W[i] == 1) {
X[i] += 0.5;
} else... | a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> N >> L >> T;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: n... |
s829417097 | p03747 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
int n,len,t;
double x[n];
int w[n];
for (int i=0; i<n; i++) {
cin >> x[i];
cin >> w[i];
}
for (int i=0; i<t; i++) {
for (int j=0; j<n; j++) {
// get target ant
int f = j - 1;
int b = j + 1;
if (j ... | a.cc: In function 'int main()':
a.cc:47:2: error: expected '}' at end of input
47 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s177856100 | p03747 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
int n,len,t;
double x[n];
int w[n];
for (int i=0; i<n; i++) {
cin >> x[i];
cin >> w[i];
}
for (int i=0; i<t; i++) {
for (int j=0; j<n; j++) {
// get target ant
int f = j - 1;
int b = j + 1;
if (j ... | a.cc: In function 'int main()':
a.cc:19:26: error: expected ';' before '}' token
19 | if (j == 0) { f = n }
| ^~
| ;
a.cc:47:2: error: expected '}' at end of input
47 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ... |
s375001709 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int N,L,T,S=0,x;
cin>>N>>L>>T;
vector<long long int>X(N),H(N),W(N);
for(long long int i=0;i<N;i++){
cin>>X.at(i)>>W.at(i);
H.at(i)=X.at(i);
}
for(long long int i=0;i<N;i++){
if(W.at(i)==1)X.at(i)=(X.at(i)+T)%L;
else X.at(i)=(... | a.cc: In function 'int main()':
a.cc:25:11: error: no matching function for call to 'min(long long int&, int)'
25 | if(q<min(N,3)&&H.at(q)-H.at(0)!=X.at((p+q)%N)-X.at(p)&&X.at((p+1)%N)==x)p++;
| ~~~^~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-... |
s145928270 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
/*座標0を軸としてアリの順番が何匹ずれたかだけを記憶し、順番は考慮せずにアリが存在する位置を計算。
アリが座標0を通るたびにアリの順番をずらす。
位置をソートしたのち、アリがずれた分だけ配列をずらして出力。*/
int main(void){
int N, L, T, x, w, gap;
cin >> N >> L >> T;
vector<int> X;
rep(i,N){
cin >> x >> w;
... | a.cc: In function 'int main()':
a.cc:17:42: error: expected ';' before '}' token
17 | X.emplace_back(((x % L) + L) % L)
| ^
| ;
18 | }
| ~
|
s955391404 | p03747 | C++ | 1. #include<bits/stdc++.h>
2. #define N 100005
3. using namespace std;
4. int n,L,t,a[N],num;
5. int main()
6. {
7. int i,x,y;
8. cin>>n>>L>>t;
9. for(i=0;i<n;i++){
10. scanf("%d %d",&x,&y);
11. x+=(y==1 ? t : -t);
12. (num+=x/L)%=n,x%=L;
13. if(x<0) x+=L,num--;
14. a[i]=x;
15. }
16. sort(a,a+n);
17. ... | a.cc:1:9: error: stray '#' in program
1 | 1. #include<bits/stdc++.h>
| ^
a.cc:2:9: error: stray '#' in program
2 | 2. #define N 100005
| ^
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1. #include<bits/stdc++.h>
| ^~
a.cc:4:1: error: ex... |
s978938534 | p03747 | C++ | #include <bits/stdc++.h>
#define int long long
#define inf 0x3f3f3f3f3f3f3f3f
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define inv(x) Power(x, mod - 2)
#define fi first
#define se second
#define N 200005
using namespace std;
typedef pair<int,int> Pair;
typedef long long ll;
const int mod = 1e9 + 7;
inline int ... | a.cc:37:16: error: '<unnamed struct>::operator long long int()' cannot be overloaded with '<unnamed struct>::operator long long int()'
37 | inline operator long long () { return input<long long>(); }
| ^~~~~~~~
a.cc:36:16: note: previous declaration '<unnamed struct>::operator long long ... |
s115274795 | p03747 | C++ | #include<bits/stdc++.h>
const int maxn = 100035;
int a[maxn],n,l,t,x,cnt;
int main()
{
scanf("%d%d%d",&n,&l,&t);
for (int i=1; i<=n; i++)
{
scanf("%d%d",&a[i],&x);
a[i] += x==1?t:-t;
cnt += a[i]/l;
if (a[i]%l<0) cnt--; //就是这里细节的处理
((a[i]%=l)+=l)%=l;
}
... | a.cc:14:29: error: extended character is not valid in an identifier
14 | if (a[i]%l<0) cnt--; //就是这里细节的处理
| ^
a.cc:14:29: error: extended character is not valid in an identifier
a.cc:14:29: error: extended character is not valid in an identifier
a.cc:14:29: erro... |
s719353416 | p03747 | C++ | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
... | a.cc:36:20: error: ISO C++ forbids declaration of 'div_minus' with no type [-fpermissive]
36 | template <class T> div_minus (T a, T b) {
| ^~~~~~~~~
|
s428115829 | p03747 | C | #include<bits/stdc++.h>
#define fo(i,a,b) for(i=a;i<=b;i++)
using namespace std;
#define ll long long
const int maxn=100000+10;
int x[maxn],xx[maxn],w[maxn];
int i,j,k,l,r,s,t,n,m;
ll c;
inline int read()
{
int k=1;int x=0;
char ch=getchar();
while ((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
if(ch=='-')
... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s067990681 | p03747 | Java | import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// 整数の入力
int n = sc.nextInt();
int l = sc.nextInt();
long t = sc.nextInt();
int[] x = new int[n];
int[] w = new int[n];... | Main.java:72: error: incompatible types: possible lossy conversion from long to int
int offset = list.indexOf(firstIndex)-counter;
^
1 error
|
s525428667 | p03747 | Java | import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// 整数の入力
int n = sc.nextInt();
int l = sc.nextInt();
long t = sc.nextInt();
int[] x = new int[n];
int[] w = new int[n];... | Main.java:72: error: incompatible types: possible lossy conversion from long to int
int offset = list.indexOf(firstIndex)-counter;
^
1 error
|
s289088435 | p03747 | C++ | kos amat
| a.cc:1:1: error: 'kos' does not name a type
1 | kos amat
| ^~~
|
s947178936 | p03747 | C++ | #include<cstdio>
#include<cstdlib>
#include<cassert>
#include<iostream>
#include<vector>
#include<algorithm>
#define int long long
using namespace std;
inline int read()
{
int x=0; bool f=1; char c=getchar();
for(;!isdigit(c);c=getchar()) if(c=='-') f=0;
for(; isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(c^'0');
if(f)... | a.cc:22:21: error: 'llong' does not name a type; did you mean 'ulong'?
22 | int id,dir; llong x,endpos;
| ^~~~~
| ulong
a.cc:24:8: error: 'llong' was not declared in this scope; did you mean 'ulong'?
24 | vector<llong> endpos;
| ^~~~~
... |
s348212449 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
int x[100010],w[100010];
int ans[100010];
int n,L,r,t;
long long fldl;
int main()
{
scanf("%d%d%d",&n,&L,&t);
for(int i = 1;i <= n;i++)
{
scanf("%d%d",&x[i],&w[i]);
if(w[i] == 2)w[i] = -1;
}
for(int i = 1;i <= n;i++)
{
len = x[i] + w[i] *... | a.cc: In function 'int main()':
a.cc:17:9: error: 'len' was not declared in this scope
17 | len = x[i] + w[i] * t;
| ^~~
|
s580745275 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll N, L, T;
cin >> N >> L >> T;
ll x[N], w[N];
for(int i = 0; i < N; i++){
cin >> x[i] >> w[i];
}
ll xx[N], ww[N];
for(int i = 0; i < N; i++){
xx[i] = x[i];
ww[i] = w[i];
}
for(int i = 0; i < N; i++){
if(w... | a.cc: In function 'int main()':
a.cc:68:27: error: expected ']' before ')' token
68 | cout << xx[(i+count)%N)] << endl;
| ^
| ]
a.cc:68:27: error: expected ';' before ')' token
68 | cout << xx[(i+count)%N)] << endl;
| ... |
s148048930 | p03747 | C++ | #include <bits/stdc++.h>
int ri() {
int n;
scanf("%d", &n);
return n;
}
std::pair<bool, int> x0_pos(int64_t n, int64_t l, int64_t t, int64_t *x, int64_t *w) { // true if it's forwarding
t *= 2;
// assume w[0] = true
// first collision of x[0] ahead
int first_col;
int first_col_dist = 1000000001;
for (int i =... | In file included from /usr/include/c++/14/cassert:44,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
from a.cc:1:
a.cc: In function 'std::pair<bool, int> x0_pos(int64_t, int64_t, int64_t, int64_t*, int64_t*)':
a.cc:42:42: error: expected primary-expression before '-=' tok... |
s643687472 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int counting=0;
int N,L,T;
cin >> N >> L >> T;
int x[N];
int vec[2];
for(int i=0; i<N; i++){
cin >> x[i] >> vec[i];
}
for (i=0; i<N; i++){
if(vec[i] == 1){
x[i] += T;
}else if(vec[i] == 2){
k[i] -= T;
}
}
... | a.cc: In function 'int main()':
a.cc:15:8: error: 'i' was not declared in this scope
15 | for (i=0; i<N; i++){
| ^
a.cc:19:7: error: 'k' was not declared in this scope
19 | k[i] -= T;
| ^
a.cc:23:7: error: 'i' was not declared in this scope
23 | for(i=0; i<N; i++){
| ... |
s460756011 | p03747 | C++ | #include<bits/stdc++>
using namespace std;
int main(){
int N,L,T,k;
double X[1000000000];
int W[1000000000];
cin >> N >> L >> T;
for(int i=0; i<N; i++){
cin >> X[i] >> W[i];
}
int TIME=2*T;
int newT;
for(newT=0; newT<TIME; newT++){
//座標操作
for(i=0; i<N; i++){
if(W[i] == 1){
... | a.cc:1:9: fatal error: bits/stdc++: No such file or directory
1 | #include<bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s823443697 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(),V.end()
ll L;
ll lmod(ll A) {
if (A < 0) {
A = 0 - A;
A %= L;
A = L - A;
}
else A %= L;
return A;
}
int main() {
ll N, T, X, W, X1, W1;
cin >> N >> L >> T;
vector<ll> Lant;
vector<ll> Rant;
vector<ll> last(N);
... | a.cc: In function 'int main()':
a.cc:92:19: error: 'lower' was not declared in this scope; did you mean 'tolower'?
92 | auto it = lower(all(last), X1);
| ^~~~~
| tolower
|
s031115188 | p03747 | C++ | #include <iostream>
#include <utility>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll l, t;
ll round(ll a, ll b){
return t * a / (l * (a + b));
}
int main()
{
ll n;
cin >> n >> l >> t;
ll x[100002];
int w[100002];
ll ans[100002];
P left[100002], right[100002];
l... | a.cc: In function 'int main()':
a.cc:111:5: error: 'sort' was not declared in this scope; did you mean 'short'?
111 | sort(ans, ans + n);
| ^~~~
| short
|
s015749725 | p03747 | C++ | using namespace std;
int N, L, T;
//a 時計回り
//b 逆時計回り
int main() {
cin >> N >> L >> T;
vector<int> a(N), b(N);
int ac = 0;
int bc = 0;
int ai0 = 0;
int av0 = 0;
int ab0 = 0;
for (int i = 0; i < N; i ++){
int ci, wi;
cin >> ci >> wi;
if (wi == 1) {
if ... | a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
7 | cin >> N >> L >> T;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:8:5: ... |
s359329829 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x)... | a.cc: In function 'int main()':
a.cc:47:51: error: 'dis' was not declared in this scope; did you mean 'dist'?
47 | if(dist<2*T)cnt += 1+(2*T-dis-1)/L;
| ^~~
| dist
|
s421711698 | p03747 | C++ | #include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vv vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<... | a.cc:29:15: error: invalid conversion from 'long long int (*)(long long int, long long int)' to 'long long int' [-fpermissive]
29 | int meets(dist) {
| ^
| |
| long long int (*)(long long int, long long int)
a.cc:29:17: error: expected ',' or ';' before '{'... |
s786376400 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
const i64 MOD = 1e9+7;
const i64 INF = 1e18+7;
signed main(){
i64 n, l, t;
cin >> n >> l >> t;
vector<i64> a(n), b(n);
vector<i64> after(n);
for(int i = 0; i < n; ++i){
cin >> a[i] >> b[i];
--b[i];
afte... | a.cc: In function 'int main()':
a.cc:50:47: error: expected ';' before '}' token
50 | cout << after[(po_ind + conf + i) % n]
| ^
| ;
51 | }
| ~
|
s618199475 | p03747 | C++ | //By Don4ick
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned int ui;
#define int long long
#define forn(i, n) for (int i = 1; i <= n; i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define y1 qewr1234
const double PI = acos(-1.0);
const i... | cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:114:15: error: expected ';' before 'for'
114 | T *= 2
| ^
| ;
115 | for (int i = 0; i < n; i++)
| ~~~
a.cc:115:25: error: 'i' was not declared in this scope; did ... |
s161706579 | p03747 | C++ | #include <bits/stdc++.h>
#define newline printf ("\n")
#define space printf (" ")
#define cinfalse ios::sync_with_stdio(false)
#define fread(a) freopen (a".in", "r", stdin), freopen(a".out", "w", stdout)
#define rint register int
#define For(i, a, b) for (rint i = a; i <= b; i ++)
#define Low(i, a, b) for (rint i = a; ... | a.cc:13:2: error: invalid preprocessing directive #deefine; did you mean #define?
13 | #deefine ll long long
| ^~~~~~~
| define
a.cc:17:1: error: 'll' does not name a type
17 | ll c;
| ^~
a.cc: In function 'int main()':
a.cc:23:19: warning: ISO C++17 does not allow 'register' storage class spe... |
s037523979 | p03747 | C++ | //copy from Antiquality
//https://www.cnblogs.com/antiquality/p/9102470.html
#include<bits/stdc++.h>
const int maxn = 100035;
int a[maxn],n,l,t,x,cnt;
int main()
{
scanf("%d%d%d",&n,&l,&t);
for (int i=1; i<=n; i++)
{
scanf("%d%d",&a[i],&x);
a[i] += x==1?t:-t;
cnt += a[i]/l;
... | a.cc:17:29: error: extended character is not valid in an identifier
17 | if (a[i]%l<0) cnt--;
| ^
a.cc:17:29: error: extended character is not valid in an identifier
a.cc:17:29: error: extended character is not valid in an identifier
a.cc:17:29: error: extended... |
s731707243 | p03747 | C++ | #include<bits/stdc++.h>
const int maxn = 100035;
int a[maxn],n,l,t,x,cnt;
int main()
{
scanf("%d%d%d",&n,&l,&t);
for (int i=1; i<=n; i++)
{
scanf("%d%d",&a[i],&x);
a[i] += x==1?t:-t;
cnt += a[i]/l;
if (a[i]%l<0) cnt--; //就是这里细节的处理
((a[i]%=l)+=l)%=l;
}
... | a.cc:14:29: error: extended character is not valid in an identifier
14 | if (a[i]%l<0) cnt--; //就是这里细节的处理
| ^
a.cc:14:29: error: extended character is not valid in an identifier
a.cc:14:29: error: extended character is not valid in an identifier
a.cc:14:29: erro... |
s938175802 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void) {
scanf("%d%d%d", &n, &L, &T);
for(int i = 1, ty; i <= n; i++) {
scanf("%d%d", &p[i], &ty);
if(ty == 2)
v.push_back(make_pair(i, p[i]));
else
o.push_back(make_pair(i, p[i]));
id[i] = i;
}
int lim = o.size();
for(int i... | a.cc: In function 'int main()':
a.cc:5:20: error: 'n' was not declared in this scope; did you mean 'yn'?
5 | scanf("%d%d%d", &n, &L, &T);
| ^
| yn
a.cc:5:24: error: 'L' was not declared in this scope
5 | scanf("%d%d%d", &n, &L, &T);
| ... |
s122197537 | p03747 | C++ | #include<iostream>
#include<vector>
using namespace std;
struct p{
long long first;
int w;
bool operator<(const p & right) const {
return first == right.first ? w < right.w : first < right.first;
}
};
int main(){
long long n, l, t; cin >> n >> l >> t;
vector< p > x(n);
for(int i = 0 ; i < n; i++){... | a.cc: In function 'int main()':
a.cc:32:3: error: 'sort' was not declared in this scope; did you mean 'short'?
32 | sort(x.begin(), x.end());
| ^~~~
| short
|
s140901594 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
int amin()
{
int a,b,c,n[1001],m[1001];
cin>>a>>b>>c;
for(int i=1;i<=a;i++)
cin>>n[i]>>m[i];
if(b==8)
{
cout<<"1"<<endl;
cout<<"3"<<endl;
cout<<"0"<<endl;
}
else if(b==20)
{
cout<<"7"<<endl;
cout<<"18"<<endl;
cout<<"18"<<endl;
cout<... | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s437320074 | p03747 | C++ | #include<cstdio>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
#define rep(i,n) for(long long int i=0;i<n;i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define mp make_pair
#define LLIandI pair<long long int , int>
/*
1≤N≤10^5
1≤L≤10^9
1≤T≤10^9
0≤X1<X2<…<X... | a.cc: In function 'int main()':
a.cc:50:4: error: 'i' was not declared in this scope
50 | if(i<N-1&&list_ans[zero_to_what_x]==list_ans[zero_to_what_x+1]){
| ^
|
s533242689 | p03747 | C++ | #include<algorithm>
#include<iostream>
using namespace std;
int a[100035],n,l,t,x,cnt;
int main(){
cin>>n>>l>>t;
for(int i=1;i<=n;i++){
cin>>a[i]>>x;
a[i]+=((x==1)?t:-t);
cnt+=a[i]/l;
if(a[i]%l<0){
cnt--; //就是这里细节的处理
}
((a[i]%=l)+=l)%=l;
}
sort(a+1,a+n+1);
... | a.cc:12:31: error: extended character is not valid in an identifier
12 | cnt--; //就是这里细节的处理
| ^
a.cc:12:31: error: extended character is not valid in an identifier
a.cc:12:31: error: extended character is not valid in an identifier
a.cc:12:31: ... |
s643612573 | p03747 | C++ | object Main {
def main(args: Array[String]): Unit = {
import scala.io.StdIn.readLine
val Array(n, l, t) = readLine().split(" ").map(_.toInt)
val ants = (1 to n).map(i => {
val Array(x, w) = readLine().split(" ").map(_.toInt)
Ant(i, x * 2, if (w == 1) Positive else Negative)
})
f(l, t *... | a.cc:1:1: error: 'object' does not name a type
1 | object Main {
| ^~~~~~
a.cc:30:1: error: 'sealed' does not name a type
30 | sealed trait Direction
| ^~~~~~
|
s691102251 | p03747 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <numeric> //accumulate
using ll = long long;
using namespace std;
int main() {
ll n, l, t;
cin >> n >> l >> t;
vector<ll> x(n), w(n);
for (int i = 0; i < n; i++){
cin >> x[i] >> w[i];
}
int wr = 0;
for (int i = 1; i... | a.cc: In function 'int main()':
a.cc:62:9: error: 'elif' was not declared in this scope
62 | elif (y[i] == x_1) j = i;
| ^~~~
|
s445966955 | p03747 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <numeric> //accumulate
using ll = long long;
using namespace std;
int main() {
ll n, l, t;
cin >> n >> l >> t;
vector<ll> x(n), w(n);
for (int i = 0; i < n; i++){
cin >> x[i] >> w[i];
}
int wr = 0;
for (int i = 1; i... | a.cc: In function 'int main()':
a.cc:61:9: error: 'elseif' was not declared in this scope
61 | elseif (y[i] == x_1) j = i;
| ^~~~~~
|
s412967494 | p03747 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <numeric> //accumulate
using ll = long long;
using namespace std;
int main() {
ll n, l, t;
cin >> n >> l >> t;
vector<ll> x(n), w(n);
for (int i = 0; i < n; i++){
cin >> x[i] >> w[i];
}
int wr = 0;
for (int i = 1; i... | a.cc: In function 'int main()':
a.cc:61:9: error: 'elif' was not declared in this scope
61 | elif (y[i] == x_1) j = i;
| ^~~~
|
s766983567 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
long long int N, L, T;
long long int X[100010];
long long int W[100010], Y[100010], Z[100010],S[100010], U[100010];
long long int A[100010], B[100010];
long long int a=0, b=0;
long long int pmod(long long int x, long long int a){
if (x%a<0) return x%a+a;
else return x%... | a.cc: In function 'long long int locate_0(long long int)':
a.cc:56:52: error: expected ';' before ')' token
56 | if (i%2==0) return (A[pmod((i-2)/2,a)]+t)%L);
| ^
| ;
a.cc:56:52: error: expected ... |
s516957409 | p03747 | C++ | #include<iostream>
using namespace std;
typedef long long ll;
int main() {
ll n,l,t;
cin >> n >> l >> t;
l *= 2;
t *= 2;
ll x[n], w[n], y[n];
for(int i=0;i<n;i++){
cin >> x[i] >> w[i];
x[i] *= 2;
if(w[i] == 1){
y[i] = (x[i] + t) % l;
}else{
... | a.cc: In function 'int main()':
a.cc:22:5: error: 'sort' was not declared in this scope; did you mean 'short'?
22 | sort(y, y+n);
| ^~~~
| short
|
s652357790 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define FORR(I,A,B) for(ll I = (B-1); I >= (A); --I)
const ll INF=1e18+7;
const ll MOD=1e9+7;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
ll n,l,t;
cin>>n>>l>>t;
vec... | a.cc: In function 'int main()':
a.cc:25:22: error: expected primary-expression before '<' token
25 | if(x=<0)pass0--;
| ^
|
s681176450 | p03747 | C++ | #include <cstdio>
#include <vector>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()
using ll = long long;
ll N, L, T;
std::vector<ll> vs;
ll cnt;
int main()
{
scanf( "%lld%lld%lld", &N, &L, &T );
rep( i, N )
{
ll X, W;
scanf( "%lld%lld", &... | a.cc: In function 'int main()':
a.cc:36:8: error: 'sort' is not a member of 'std'
36 | std::sort( all(vs) );
| ^~~~
|
s203617717 | p03747 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <functional>
#include <string>
#include <stack>
#include <set>
#include <sstream>
#include <iomanip>
#include <limits>
#include <cstring>
using namespace std;
using ll = long long;
typedef unsigned long... | a.cc: In function 'int main()':
a.cc:74:47: error: expected ';' before '}' token
74 | cout << place[(i+n)%n] << endl
| ^
| ;
75 | }
| ~ ... |
s805604853 | p03747 | C++ | #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <stack>
#include <fstream>
#include <cstdint>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
#include <functional>
using namespace std;
typedef int64_t ll;
typedef uint64_t ull;... | a.cc:90:5: error: expected unqualified-id before 'else'
90 | else {
| ^~~~
a.cc:95:1: error: expected declaration before '}' token
95 | }
| ^
|
s237649038 | p03747 | Java | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer... | Main.java:13: error: class ACG_013C is public, should be declared in a file named ACG_013C.java
public class ACG_013C {
^
1 error
|
s155704311 | p03747 | C++ | #include<bits/stdc++.h>
int a[100035],n,l,t,x,y;
long long cnt;
int main()
{
scanf("%d%d%d",&n,&l,&t);
for (int i=1; i<=n; i++)
{
scanf("%d%d",&x,&y);
if (y==1){
x += t;
cnt += x/l;
x %= l;
}else{
cnt += (x-t)/l;
x = (x-t)... | a.cc: In function 'int main()':
a.cc:24:14: error: lvalue required as left operand of assignment
24 | ((cnt%=n)+n)%=n;
| ~~~~~~~~~^~~
|
s000370820 | p03747 | C++ | #include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
#define maxn 200005
typedef long long ll;
ll l,n,T,x[200005];
ll w[200005],t[200005];
ll sum[200005],ans[200005];
ll f(ll x){
while(x<0)x+=l;
return x%l;
}
ll calc(int left,int right,int p){
if(p==1)return sum[right]-sum[left];
else re... | a.cc: In function 'int main()':
a.cc:43:3: error: 'memset' was not declared in this scope
43 | memset(ans,-1,sizeof(ans));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cmath>
+++ |+#include <cstring>
4 | ... |
s909554310 | p03747 | C++ | #include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
#define maxn 200005
typedef long long ll;
ll l,n,T,x[200005];
ll w[200005],t[200005];
ll sum[200005],ans[200005];
ll f(ll x){
while(x<0)x+=l;
return x%l;
}
ll calc(int left,int right,int p){
if(p==1)return sum[right]-sum[left];
else re... | a.cc: In function 'int main()':
a.cc:43:3: error: 'memset' was not declared in this scope
43 | memset(ans,-1,sizeof(ans));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cmath>
+++ |+#include <cstring>
4 | ... |
s661665260 | p03747 | C++ | #include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
using namespace std;
int main()
{
int n, w[100001];
long long int l, t, x[100001], y[100001];
scanf("%d %lld %lld", &n, &l, &t);
l=l*2;
t=t*2;
vector<int> i1, i2;
int e1=0... | a.cc: In function 'int main()':
a.cc:116:2: error: expected '}' at end of input
116 | }
| ^
a.cc:13:1: note: to match this '{'
13 | {
| ^
|
s304419162 | p03747 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition... | a.cc: In function 'int main()':
a.cc:145:36: error: expected ';' before ')' token
145 | diff[i]=(x[i]-t)%l+l)%l;
| ^
| ;
|
s354672628 | p03747 | C++ |
//1番の蟻の動きと他の蟻の位置
REP(i,2*t){
//cout<<"time "<<i*0.5+0.5<<endl;
fx = return_position(fx,fw,l);
REP(j,n){
x[j] = return_position(x[j],w[j],l);
n_a[x[j]*2]++;
//cout<<j<<"th aunt position "<<x[j]<<endl;
}
if (n_a[fx*2]==2){
fw... | a.cc:3:8: error: expected constructor, destructor, or type conversion before '(' token
3 | REP(i,2*t){
| ^
a.cc:20:9: error: expected constructor, destructor, or type conversion before '(' token
20 | sort(all(x));
| ^
a.cc:22:8: error: expected constructor, destructor, or type ... |
s959633846 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n,m) for (int i=n; i<m; i++)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#def... | a.cc: In function 'int main()':
a.cc:46:1: error: expected primary-expression before ':' token
46 | :
| ^
a.cc:48:9: error: 'i' was not declared in this scope
48 | REP(i,2*t){
| ^
a.cc:3:30: note: in definition of macro 'REP'
3 | #define REP(i,n) for(int i=0;i<n;i++)
| ... |
s857441804 | p03747 | C++ | #define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <utility>
#include <complex>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include... | a.cc: In function 'int main()':
a.cc:132:39: error: 'a' was not declared in this scope
132 | else {a
| ^
|
s802786786 | p03747 | C++ | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pb push_back
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef ve... | a.cc:23:30: error: 'll yn [110000]' redeclared as different kind of entity
23 | ll np, yp[N], ip[N], nn, yn[N], in[N];
| ^
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/... |
s175571494 | p03747 | C++ | #define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
... | a.cc:87:7: error: conflicting declaration 'using LL = LLL'
87 | using LL = LLL;
| ^~
a.cc:28:19: note: previous declaration as 'typedef long long int LL'
28 | typedef long long LL;
| ^~
|
s999824603 | p03747 | C++ | #include <iostream>
#include <vector>
using namespace std;
using int64 = long long;
int main() {
int64 N, L, T;
cin >> N >> L >> T;
vector<int64> X(N), Y(N);
vector<int> W(N);
for (int i = 0; i < N; i++) {
cin >> X[i] >> W[i];
W[i] = (W[i] == 1 ? 1 : (-1));
Y[i] = (X[i] +... | a.cc: In function 'int main()':
a.cc:41:9: error: 'sort' was not declared in this scope; did you mean 'short'?
41 | sort(Y.begin(), Y.end());
| ^~~~
| short
|
s262058378 | p03747 | C++ | #include<bits/stdc++.h>
#define N 300005
#define int long long
using namespace std;
int n,l,t;
int x[N],w[N];
int v[N];
signed main()
{
scanf("%lld%lld%lld",&n,&l,&t);
l*=2;t*=2;
for(int i=1;i<=n;i++)
{
scanf("%lld%lld",&x[i],&w[i]);
x[i]*=2;
if(w[i]==2)w[i]=-1;
v[i]=((x... | a.cc: In function 'int main()':
a.cc:60:10: error: 'i' was not declared in this scope
60 | if(w[i]==1)
| ^
|
s473489441 | p03747 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
#define w1 first
#define w2 second
#define ls (x<<1)
#define rs (x<<1|1)
#define pb push_back
#define mid ((l+r)>>1)
#define SZ(x) ((x).size())
#define All(x) (x).begin(),(x).end()
#define rep(i,a,b) for(ll (i)=(a);(i)<=(b);(i)++)
#de... | a.cc: In function 'int main()':
a.cc:54:19: error: 'prllf' was not declared in this scope
54 | rep(i,1,n)prllf("%d\n",ans[i]);
| ^~~~~
|
s122144688 | p03747 | C++ | #include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
const int MAX_N = 100005;
int id[MAX_N], X[MAX_N], W[MAX_N];
bool cmp(int a, int b) {
if (X[a] != X[b]) return X[a] < X[b];
return W[a] > W[b];
}
int main() {
int N, L, T;
scanf("%d%d%d", &N, &L, &T);
int tot = 0;
for (int... | a.cc: In function 'int main()':
a.cc:43:12: error: expected '}' at end of input
43 | return 0;
| ^
a.cc:15:12: note: to match this '{'
15 | int main() {
| ^
|
s755543672 | p03747 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
typedef long long ll;
int main()
{
ll N, L, T; cin >> N >> L >> T;
vector<ll>X(N), W(N);
for (int i = 0; i < N; i++) {
cin >> X[i] >> W[i];
}
vector<pair<double,int>>Y(N);
for (int i = 0; i < N; i++) {
ll y = X... | a.cc: In function 'int main()':
a.cc:49:33: error: 'ceil' was not declared in this scope
49 | tmpT -= ceil(D / 2.);
| ^~~~
|
s993056953 | p03747 | C++ | n,l,t=map(int,input().split())
a,cs=[0]*n,0
for i in range(n):
x,y=map(int,input().split())
x+=(t if y==1 else -t)
cs=(cs+x//l)%n
x%=l
if x<0:
x+=l
cs-=1
a[i]=x
a.sort()
print('\n'.join([str(a[(i+cs+n)%n]) for i in range(n)])) | a.cc:1:1: error: 'n' does not name a type
1 | n,l,t=map(int,input().split())
| ^
|
s582629949 | p03747 | C++ | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 1e5 + 2;
int n, l, t, pos[N], dir[N];
vector<int>pos_set;
long long int0(int idx) {#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 1e5 + 2;
int n, l, t, pos[N], dir[N];
vector<int>pos_set;
long long... | a.cc:10:26: error: stray '#' in program
10 | long long int0(int idx) {#include <bits/stdc++.h>
| ^
a.cc: In function 'long long int int0(long long int)':
a.cc:10:27: error: 'include' was not declared in this scope
10 | long long int0(int idx) {#include <bits/stdc++.h>
| ... |
s995154125 | p03747 | C++ | #include<bits/stdc++.h>
#define int long long
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
int x[100000], w[100000], y[100000];
int ans[100000];
signed main() {
int n, l, t; scanf("%lld%lld%lld", &n, &l, &t);
int X;
rep(i, n) {
scanf("%lld%lld", &x[i], &w[i]);
if (w[i] == 1)y[i] = (x[i] + t) % l;... | a.cc: In function 'int main()':
a.cc:24:44: error: expected primary-expression before 'long'
24 | if (t >= d)(cnt += long long((t - d) / (l / 2.)) + 1) %= n;
| ^~~~
a.cc:24:43: error: expected ')' before 'long'
24 | i... |
s688416102 | p03747 | C++ | #include<bits/stdc++.h>
#define int long long
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
int x[100000], w[100000], y[100000];
int ans[100000];
signed main() {
int n, l, t; scanf("%lld%lld%lld", &n, &l, &t);
int X;
rep(i, n) {
scanf("%lld%lld", &x[i], &w[i]);
if (w[i] == 1)y[i] = (x[i] + t) % l;... | a.cc: In function 'int main()':
a.cc:2:13: error: expected primary-expression before 'long'
2 | #define int long long
| ^~~~
a.cc:24:44: note: in expansion of macro 'int'
24 | if (t >= d)(cnt += int((t - d) / (l / 2.)) + 1) %= n;
| ... |
s388741607 | p03747 | C++ | #include <cstdio>
#include <string>
#include <vector>
#include <iostream>
const int maxn = 100010;
using namespace std;
int N, L, T, X[maxn];
int bSearch(int value, int low, int high, vector<int> b, int t)
{
int mid, ret = 0;
while (low <= high)
{
mid = (low + high);
if ( (2 * T - (b[mid] - value)) / L + 1 == t... | a.cc: In function 'std::vector<int> solve(std::vector<int>, std::vector<int>, int)':
a.cc:36:17: error: 'reverse' was not declared in this scope
36 | reverse(a.begin(), a.end());
| ^~~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.